
//-------------------------------------------------------------------------
//   Copyright 2002-2021 National Technology & Engineering Solutions of
//   Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
//   NTESS, the U.S. Government retains certain rights in this software.
//
//   This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
//   Xyce(TM) is free software: you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   Xyce(TM) is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with Xyce(TM).
//   If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
//
// Purpose        :
//
// Special Notes  : Generated from verilog file fbhhbt-2.1_nonoise_limited_inductors_typed.va with ADMS
//                  interface for Xyce 7.3.0
//                  DO NOT EDIT THIS FILE DIRECTLY!  It may be overwritten!
//
// Creator        : admsXml-2.3.6
//
// Creation Date  : Sun, 18 Apr 2021 10:09:00
//
//-------------------------------------------------------------------------
// Shut up clang's warnings about extraneous parentheses
#ifdef __clang__
#  pragma clang diagnostic ignored "-Wparentheses-equality"
#endif

#include <Xyce_config.h>
#include <N_DEV_ADMSHBT_X.h>


#include <N_DEV_Const.h>
#include <N_DEV_DeviceOptions.h>
#include <N_DEV_DeviceMaster.h>
#include <N_DEV_ExternData.h>
#include <N_DEV_SolverState.h>
#include <N_DEV_Message.h>

#include <N_LAS_Matrix.h>
#include <N_LAS_Vector.h>


#include <N_UTL_FeatureTest.h>
#include <unordered_map>
using std::unordered_map;

#include <algorithm>

// Xyce_config.h contains a VERSION macro from autoconf, and some
// Verilog-A models like to define a variable of that name.  This can be
// a serious problem, and we don't need the VERSION macro.  Get rid of it.
// This must happen *after* all includes of Xyce headers, each of which
// includes Xyce_config.h!
#ifdef VERSION
#undef VERSION
#endif

namespace Xyce {
namespace Device {
namespace ADMSHBT_X {
namespace AnalogFunctions {
// Derivative of Analog Function exp_soft
double d_exp_soft(double x  , double d_x )
{
  // Function return variable and total deriv
  double exp_soft;
  double d_exp_soft;
  // Derivatives of return value w.r.t input vars
  double d_exp_soft_d_x;
  double maxexp;
  double d_maxexp_d_x;
  double maxarg;
  double d_maxarg_d_x;
  {
    d_maxexp_d_x=0.0;
    maxexp=1.0e25;
    d_maxarg_d_x=(1.0/maxexp)*d_maxexp_d_x;
    maxarg=log(maxexp);
    if((x<maxarg))
    {
      d_exp_soft_d_x=exp(x);
      exp_soft=exp(x);
    }
    else
    {
      d_exp_soft_d_x=((((x+1.0)-maxarg)*d_maxexp_d_x)+((1.0-d_maxarg_d_x)*maxexp));
      exp_soft=(((x+1.0)-maxarg)*maxexp);
    }
  }
  d_exp_soft = d_exp_soft_d_x*d_x;
  return(d_exp_soft);
}

// Evaluator class implementations for Analog Function exp_soft
// Constructor
exp_softEvaluator::exp_softEvaluator(double x)
{
  exp_softReturn_ = evaluator_(x);
}
// method to get precomputed values into double vars 
double exp_softEvaluator::getValues(double  x)
{
  // Silence unused argument warnings
  (void) x;
  // Copy all precomputed values into corresponding output
  return(exp_softReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double exp_softEvaluator::getDerivs(double x  , double d_x)
{
  // Function total deriv
  double d_exp_soft;
  // Silence unused argument warnings
  (void) x;
  d_exp_soft = exp_softReturn_.deriv_WRT_x*d_x;
  return(d_exp_soft);
}
// method that actually performs our computations.
exp_softEvaluator::returnType exp_softEvaluator::evaluator_(double x)
{
  // Function value and derivs variables, and a returnType to store everything
  double exp_soft;
  exp_softEvaluator::returnType exp_softReturn;
  // Derivatives of return value w.r.t input vars
  double d_exp_soft_d_x;
  // declared local variables
  double maxexp;
  double d_maxexp_d_x;
  double maxarg;
  double d_maxarg_d_x;
  {
    d_maxexp_d_x=0.0;
    maxexp=1.0e25;
    d_maxarg_d_x=(1.0/maxexp)*d_maxexp_d_x;
    maxarg=log(maxexp);
    if((x<maxarg))
    {
      d_exp_soft_d_x=exp(x);
      exp_soft=exp(x);
    }
    else
    {
      d_exp_soft_d_x=((((x+1.0)-maxarg)*d_maxexp_d_x)+((1.0-d_maxarg_d_x)*maxexp));
      exp_soft=(((x+1.0)-maxarg)*maxexp);
    }
  }
  // now save outputs and derivs into appropriate return vars
  exp_softReturn.value=exp_soft;
  exp_softReturn.deriv_WRT_x = d_exp_soft_d_x;
  return(exp_softReturn);
}

// Derivative of Analog Function Vt
double d_Vt(double U , double Ud  , double d_U , double d_Ud )
{
  // Function return variable and total deriv
  double Vt;
  double d_Vt;
  // Derivatives of return value w.r.t input vars
  double d_Vt_d_U;
  double d_Vt_d_Ud;
  double Vch;
  double d_Vch_d_U;
  double d_Vch_d_Ud;
  double VF;
  double d_VF_d_U;
  double d_VF_d_Ud;
  {
    d_Vch_d_U=0.0;
    d_Vch_d_Ud=(0.1);
    Vch=(0.1*Ud);
    d_VF_d_U=0.0;
    d_VF_d_Ud=(0.9);
    VF=(0.9*Ud);
    if((U<VF))
    {
      d_Vt_d_U=(1.0-((Vch*(1.0/(1.0+exp(((U-VF)/Vch))))*exp(((U-VF)/Vch))*((Vch*(1.0-d_VF_d_U)-(U-VF)*d_Vch_d_U)/Vch/Vch))+(d_Vch_d_U*log((1.0+exp(((U-VF)/Vch)))))));
      d_Vt_d_Ud=(-((Vch*(1.0/(1.0+exp(((U-VF)/Vch))))*exp(((U-VF)/Vch))*((Vch*(-d_VF_d_Ud)-(U-VF)*d_Vch_d_Ud)/Vch/Vch))+(d_Vch_d_Ud*log((1.0+exp(((U-VF)/Vch)))))));
      Vt=(U-(Vch*log((1.0+exp(((U-VF)/Vch))))));
    }
    else
    {
      d_Vt_d_U=(d_VF_d_U-((Vch*(1.0/(1.0+exp(((VF-U)/Vch))))*exp(((VF-U)/Vch))*((Vch*(d_VF_d_U-1.0)-(VF-U)*d_Vch_d_U)/Vch/Vch))+(d_Vch_d_U*log((1.0+exp(((VF-U)/Vch)))))));
      d_Vt_d_Ud=(d_VF_d_Ud-((Vch*(1.0/(1.0+exp(((VF-U)/Vch))))*exp(((VF-U)/Vch))*((Vch*d_VF_d_Ud-(VF-U)*d_Vch_d_Ud)/Vch/Vch))+(d_Vch_d_Ud*log((1.0+exp(((VF-U)/Vch)))))));
      Vt=(VF-(Vch*log((1.0+exp(((VF-U)/Vch))))));
    }
  }
  d_Vt = d_Vt_d_U*d_U+d_Vt_d_Ud*d_Ud;
  return(d_Vt);
}

// Evaluator class implementations for Analog Function Vt
// Constructor
VtEvaluator::VtEvaluator(double U, double Ud)
{
  VtReturn_ = evaluator_(U, Ud);
}
// method to get precomputed values into double vars 
double VtEvaluator::getValues(double  U, double  Ud)
{
  // Silence unused argument warnings
  (void) U;
  (void) Ud;
  // Copy all precomputed values into corresponding output
  return(VtReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double VtEvaluator::getDerivs(double U , double Ud  , double d_U, double d_Ud)
{
  // Function total deriv
  double d_Vt;
  // Silence unused argument warnings
  (void) U;
  (void) Ud;
  d_Vt = VtReturn_.deriv_WRT_U*d_U+VtReturn_.deriv_WRT_Ud*d_Ud;
  return(d_Vt);
}
// method that actually performs our computations.
VtEvaluator::returnType VtEvaluator::evaluator_(double U, double Ud)
{
  // Function value and derivs variables, and a returnType to store everything
  double Vt;
  VtEvaluator::returnType VtReturn;
  // Derivatives of return value w.r.t input vars
  double d_Vt_d_U;
  double d_Vt_d_Ud;
  // declared local variables
  double Vch;
  double d_Vch_d_U;
  double d_Vch_d_Ud;
  double VF;
  double d_VF_d_U;
  double d_VF_d_Ud;
  {
    d_Vch_d_U=0.0;
    d_Vch_d_Ud=(0.1);
    Vch=(0.1*Ud);
    d_VF_d_U=0.0;
    d_VF_d_Ud=(0.9);
    VF=(0.9*Ud);
    if((U<VF))
    {
      d_Vt_d_U=(1.0-((Vch*(1.0/(1.0+exp(((U-VF)/Vch))))*exp(((U-VF)/Vch))*((Vch*(1.0-d_VF_d_U)-(U-VF)*d_Vch_d_U)/Vch/Vch))+(d_Vch_d_U*log((1.0+exp(((U-VF)/Vch)))))));
      d_Vt_d_Ud=(-((Vch*(1.0/(1.0+exp(((U-VF)/Vch))))*exp(((U-VF)/Vch))*((Vch*(-d_VF_d_Ud)-(U-VF)*d_Vch_d_Ud)/Vch/Vch))+(d_Vch_d_Ud*log((1.0+exp(((U-VF)/Vch)))))));
      Vt=(U-(Vch*log((1.0+exp(((U-VF)/Vch))))));
    }
    else
    {
      d_Vt_d_U=(d_VF_d_U-((Vch*(1.0/(1.0+exp(((VF-U)/Vch))))*exp(((VF-U)/Vch))*((Vch*(d_VF_d_U-1.0)-(VF-U)*d_Vch_d_U)/Vch/Vch))+(d_Vch_d_U*log((1.0+exp(((VF-U)/Vch)))))));
      d_Vt_d_Ud=(d_VF_d_Ud-((Vch*(1.0/(1.0+exp(((VF-U)/Vch))))*exp(((VF-U)/Vch))*((Vch*d_VF_d_Ud-(VF-U)*d_Vch_d_Ud)/Vch/Vch))+(d_Vch_d_Ud*log((1.0+exp(((VF-U)/Vch)))))));
      Vt=(VF-(Vch*log((1.0+exp(((VF-U)/Vch))))));
    }
  }
  // now save outputs and derivs into appropriate return vars
  VtReturn.value=Vt;
  VtReturn.deriv_WRT_U = d_Vt_d_U;
  VtReturn.deriv_WRT_Ud = d_Vt_d_Ud;
  return(VtReturn);
}

// Derivative of Analog Function diode
double d_diode(double U , double Is , double Ug , double N , double AREA , double TJ , double TNOM  , double d_U , double d_Is , double d_Ug , double d_N , double d_AREA , double d_TJ , double d_TNOM )
{
  // Function return variable and total deriv
  double diode;
  double d_diode;
  // Derivatives of return value w.r.t input vars
  double d_diode_d_U;
  double d_diode_d_Is;
  double d_diode_d_Ug;
  double d_diode_d_N;
  double d_diode_d_AREA;
  double d_diode_d_TJ;
  double d_diode_d_TNOM;
  double VTH0;
  double d_VTH0_d_U;
  double d_VTH0_d_Is;
  double d_VTH0_d_Ug;
  double d_VTH0_d_N;
  double d_VTH0_d_AREA;
  double d_VTH0_d_TJ;
  double d_VTH0_d_TNOM;
  double VTHJ;
  double d_VTHJ_d_U;
  double d_VTHJ_d_Is;
  double d_VTHJ_d_Ug;
  double d_VTHJ_d_N;
  double d_VTHJ_d_AREA;
  double d_VTHJ_d_TJ;
  double d_VTHJ_d_TNOM;
  double VTHNOM;
  double d_VTHNOM_d_U;
  double d_VTHNOM_d_Is;
  double d_VTHNOM_d_Ug;
  double d_VTHNOM_d_N;
  double d_VTHNOM_d_AREA;
  double d_VTHNOM_d_TJ;
  double d_VTHNOM_d_TNOM;
  double maxi;
  double d_maxi_d_U;
  double d_maxi_d_Is;
  double d_maxi_d_Ug;
  double d_maxi_d_N;
  double d_maxi_d_AREA;
  double d_maxi_d_TJ;
  double d_maxi_d_TNOM;
  double Tmax;
  double d_Tmax_d_U;
  double d_Tmax_d_Is;
  double d_Tmax_d_Ug;
  double d_Tmax_d_N;
  double d_Tmax_d_AREA;
  double d_Tmax_d_TJ;
  double d_Tmax_d_TNOM;
  double TJM;
  double d_TJM_d_U;
  double d_TJM_d_Is;
  double d_TJM_d_Ug;
  double d_TJM_d_N;
  double d_TJM_d_AREA;
  double d_TJM_d_TJ;
  double d_TJM_d_TNOM;
  double KDURCHQ;
  double d_KDURCHQ_d_U;
  double d_KDURCHQ_d_Is;
  double d_KDURCHQ_d_Ug;
  double d_KDURCHQ_d_N;
  double d_KDURCHQ_d_AREA;
  double d_KDURCHQ_d_TJ;
  double d_KDURCHQ_d_TNOM;
  double lnIs;
  double d_lnIs_d_U;
  double d_lnIs_d_Is;
  double d_lnIs_d_Ug;
  double d_lnIs_d_N;
  double d_lnIs_d_AREA;
  double d_lnIs_d_TJ;
  double d_lnIs_d_TNOM;
  {
    d_VTH0_d_U=0.0;
    d_VTH0_d_Is=0.0;
    d_VTH0_d_Ug=0.0;
    d_VTH0_d_N=0.0;
    d_VTH0_d_AREA=0.0;
    d_VTH0_d_TJ=0.0;
    d_VTH0_d_TNOM=0.0;
    VTH0=adms_vt((20.0+273.15));
    d_VTHNOM_d_U=0.0;
    d_VTHNOM_d_Is=0.0;
    d_VTHNOM_d_Ug=0.0;
    d_VTHNOM_d_N=0.0;
    d_VTHNOM_d_AREA=0.0;
    d_VTHNOM_d_TJ=0.0;
    d_VTHNOM_d_TNOM=CONSTKoverQ;
    VTHNOM=adms_vt((TNOM+273.15));
    d_KDURCHQ_d_U=0.0;
    d_KDURCHQ_d_Is=0.0;
    d_KDURCHQ_d_Ug=0.0;
    d_KDURCHQ_d_N=0.0;
    d_KDURCHQ_d_AREA=0.0;
    d_KDURCHQ_d_TJ=0.0;
    d_KDURCHQ_d_TNOM=0.0;
    KDURCHQ=0.861708692e-4;
    d_lnIs_d_U=0.0;
    d_lnIs_d_Is=(1.0/(Is*AREA))*(AREA);
    d_lnIs_d_Ug=0.0;
    d_lnIs_d_N=0.0;
    d_lnIs_d_AREA=(1.0/(Is*AREA))*(Is);
    d_lnIs_d_TJ=0.0;
    d_lnIs_d_TNOM=0.0;
    lnIs=log((Is*AREA));
    d_maxi_d_U=0.0;
    d_maxi_d_Is=0.0;
    d_maxi_d_Ug=0.0;
    d_maxi_d_N=0.0;
    d_maxi_d_AREA=0.0;
    d_maxi_d_TJ=0.0;
    d_maxi_d_TNOM=0.0;
    maxi=log(1e6);
    if(((maxi<(Ug/VTHNOM))&&(U<0.0)))
    {
      d_Tmax_d_U=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_U)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_U)+((-((maxi*d_VTHNOM_d_U)+(d_maxi_d_U*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_Is=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_Is)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_Is)+((-((maxi*d_VTHNOM_d_Is)+(d_maxi_d_Is*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_Ug=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_Ug+VTHNOM)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_Ug)+((1.0-((maxi*d_VTHNOM_d_Ug)+(d_maxi_d_Ug*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_N=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_N)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_N)+((-((maxi*d_VTHNOM_d_N)+(d_maxi_d_N*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_AREA=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_AREA)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_AREA)+((-((maxi*d_VTHNOM_d_AREA)+(d_maxi_d_AREA*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_TJ=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_TJ)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_TJ)+((-((maxi*d_VTHNOM_d_TJ)+(d_maxi_d_TJ*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_TNOM=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_TNOM)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_TNOM)+((-((maxi*d_VTHNOM_d_TNOM)+(d_maxi_d_TNOM*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      Tmax=(((Ug*VTHNOM)/((Ug-(maxi*VTHNOM))*KDURCHQ))-273.15);
      d_TJM_d_U=d_Vt(TJ,Tmax,0.0,d_Tmax_d_U);
      d_TJM_d_Is=d_Vt(TJ,Tmax,0.0,d_Tmax_d_Is);
      d_TJM_d_Ug=d_Vt(TJ,Tmax,0.0,d_Tmax_d_Ug);
      d_TJM_d_N=d_Vt(TJ,Tmax,0.0,d_Tmax_d_N);
      d_TJM_d_AREA=d_Vt(TJ,Tmax,0.0,d_Tmax_d_AREA);
      d_TJM_d_TJ=d_Vt(TJ,Tmax,1.0,d_Tmax_d_TJ);
      d_TJM_d_TNOM=d_Vt(TJ,Tmax,0.0,d_Tmax_d_TNOM);
      TJM=Vt(TJ,Tmax);
    }
    else
    {
      d_TJM_d_U=0.0;
      d_TJM_d_Is=0.0;
      d_TJM_d_Ug=0.0;
      d_TJM_d_N=0.0;
      d_TJM_d_AREA=0.0;
      d_TJM_d_TJ=1.0;
      d_TJM_d_TNOM=0.0;
      TJM=TJ;
    }
    d_VTHJ_d_U=CONSTKoverQ*d_TJM_d_U;
    d_VTHJ_d_Is=CONSTKoverQ*d_TJM_d_Is;
    d_VTHJ_d_Ug=CONSTKoverQ*d_TJM_d_Ug;
    d_VTHJ_d_N=CONSTKoverQ*d_TJM_d_N;
    d_VTHJ_d_AREA=CONSTKoverQ*d_TJM_d_AREA;
    d_VTHJ_d_TJ=CONSTKoverQ*d_TJM_d_TJ;
    d_VTHJ_d_TNOM=CONSTKoverQ*d_TJM_d_TNOM;
    VTHJ=adms_vt((TJM+273.15));
    if((Ug>0.0))
    {
      d_diode_d_U=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((((N*VTHJ)-(U*(N*d_VTHJ_d_U)))/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_U/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_U/VTHJ/VTHJ))+d_lnIs_d_U))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_U/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_U/VTHJ/VTHJ))+d_lnIs_d_U)));
      d_diode_d_Is=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_Is)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_Is/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_Is/VTHJ/VTHJ))+d_lnIs_d_Is))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_Is/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_Is/VTHJ/VTHJ))+d_lnIs_d_Is)));
      d_diode_d_Ug=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_Ug)/(N*VTHJ)/(N*VTHJ))+((VTHNOM-(Ug*d_VTHNOM_d_Ug))/VTHNOM/VTHNOM))-((VTHJ-(Ug*d_VTHJ_d_Ug))/VTHJ/VTHJ))+d_lnIs_d_Ug))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),((((VTHNOM-(Ug*d_VTHNOM_d_Ug))/VTHNOM/VTHNOM)-((VTHJ-(Ug*d_VTHJ_d_Ug))/VTHJ/VTHJ))+d_lnIs_d_Ug)));
      d_diode_d_N=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_N+VTHJ)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_N/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_N/VTHJ/VTHJ))+d_lnIs_d_N))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_N/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_N/VTHJ/VTHJ))+d_lnIs_d_N)));
      d_diode_d_AREA=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_AREA)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_AREA/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_AREA/VTHJ/VTHJ))+d_lnIs_d_AREA))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_AREA/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_AREA/VTHJ/VTHJ))+d_lnIs_d_AREA)));
      d_diode_d_TJ=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_TJ)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_TJ/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_TJ/VTHJ/VTHJ))+d_lnIs_d_TJ))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_TJ/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_TJ/VTHJ/VTHJ))+d_lnIs_d_TJ)));
      d_diode_d_TNOM=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_TNOM)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_TNOM/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_TNOM/VTHJ/VTHJ))+d_lnIs_d_TNOM))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_TNOM/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_TNOM/VTHJ/VTHJ))+d_lnIs_d_TNOM)));
      diode=(exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs))-exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs)));
    }
    else
    {
      d_diode_d_U=d_exp_soft(((U/(N*VTH0))+lnIs),((((N*VTH0)-(U*(N*d_VTH0_d_U)))/(N*VTH0)/(N*VTH0))+d_lnIs_d_U));
      d_diode_d_Is=(d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_Is)/(N*VTH0)/(N*VTH0))+d_lnIs_d_Is))-(AREA));
      d_diode_d_Ug=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_Ug)/(N*VTH0)/(N*VTH0))+d_lnIs_d_Ug));
      d_diode_d_N=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_N+VTH0)/(N*VTH0)/(N*VTH0))+d_lnIs_d_N));
      d_diode_d_AREA=(d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_AREA)/(N*VTH0)/(N*VTH0))+d_lnIs_d_AREA))-(Is));
      d_diode_d_TJ=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_TJ)/(N*VTH0)/(N*VTH0))+d_lnIs_d_TJ));
      d_diode_d_TNOM=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_TNOM)/(N*VTH0)/(N*VTH0))+d_lnIs_d_TNOM));
      diode=(exp_soft(((U/(N*VTH0))+lnIs))-(Is*AREA));
    }
  }
  d_diode = d_diode_d_U*d_U+d_diode_d_Is*d_Is+d_diode_d_Ug*d_Ug+d_diode_d_N*d_N+d_diode_d_AREA*d_AREA+d_diode_d_TJ*d_TJ+d_diode_d_TNOM*d_TNOM;
  return(d_diode);
}

// Evaluator class implementations for Analog Function diode
// Constructor
diodeEvaluator::diodeEvaluator(double U, double Is, double Ug, double N, double AREA, double TJ, double TNOM)
{
  diodeReturn_ = evaluator_(U, Is, Ug, N, AREA, TJ, TNOM);
}
// method to get precomputed values into double vars 
double diodeEvaluator::getValues(double  U, double  Is, double  Ug, double  N, double  AREA, double  TJ, double  TNOM)
{
  // Silence unused argument warnings
  (void) U;
  (void) Is;
  (void) Ug;
  (void) N;
  (void) AREA;
  (void) TJ;
  (void) TNOM;
  // Copy all precomputed values into corresponding output
  return(diodeReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double diodeEvaluator::getDerivs(double U , double Is , double Ug , double N , double AREA , double TJ , double TNOM  , double d_U, double d_Is, double d_Ug, double d_N, double d_AREA, double d_TJ, double d_TNOM)
{
  // Function total deriv
  double d_diode;
  // Silence unused argument warnings
  (void) U;
  (void) Is;
  (void) Ug;
  (void) N;
  (void) AREA;
  (void) TJ;
  (void) TNOM;
  d_diode = diodeReturn_.deriv_WRT_U*d_U+diodeReturn_.deriv_WRT_Is*d_Is+diodeReturn_.deriv_WRT_Ug*d_Ug+diodeReturn_.deriv_WRT_N*d_N+diodeReturn_.deriv_WRT_AREA*d_AREA+diodeReturn_.deriv_WRT_TJ*d_TJ+diodeReturn_.deriv_WRT_TNOM*d_TNOM;
  return(d_diode);
}
// method that actually performs our computations.
diodeEvaluator::returnType diodeEvaluator::evaluator_(double U, double Is, double Ug, double N, double AREA, double TJ, double TNOM)
{
  // Function value and derivs variables, and a returnType to store everything
  double diode;
  diodeEvaluator::returnType diodeReturn;
  // Derivatives of return value w.r.t input vars
  double d_diode_d_U;
  double d_diode_d_Is;
  double d_diode_d_Ug;
  double d_diode_d_N;
  double d_diode_d_AREA;
  double d_diode_d_TJ;
  double d_diode_d_TNOM;
  // declared local variables
  double VTH0;
  double d_VTH0_d_U;
  double d_VTH0_d_Is;
  double d_VTH0_d_Ug;
  double d_VTH0_d_N;
  double d_VTH0_d_AREA;
  double d_VTH0_d_TJ;
  double d_VTH0_d_TNOM;
  double VTHJ;
  double d_VTHJ_d_U;
  double d_VTHJ_d_Is;
  double d_VTHJ_d_Ug;
  double d_VTHJ_d_N;
  double d_VTHJ_d_AREA;
  double d_VTHJ_d_TJ;
  double d_VTHJ_d_TNOM;
  double VTHNOM;
  double d_VTHNOM_d_U;
  double d_VTHNOM_d_Is;
  double d_VTHNOM_d_Ug;
  double d_VTHNOM_d_N;
  double d_VTHNOM_d_AREA;
  double d_VTHNOM_d_TJ;
  double d_VTHNOM_d_TNOM;
  double maxi;
  double d_maxi_d_U;
  double d_maxi_d_Is;
  double d_maxi_d_Ug;
  double d_maxi_d_N;
  double d_maxi_d_AREA;
  double d_maxi_d_TJ;
  double d_maxi_d_TNOM;
  double Tmax;
  double d_Tmax_d_U;
  double d_Tmax_d_Is;
  double d_Tmax_d_Ug;
  double d_Tmax_d_N;
  double d_Tmax_d_AREA;
  double d_Tmax_d_TJ;
  double d_Tmax_d_TNOM;
  double TJM;
  double d_TJM_d_U;
  double d_TJM_d_Is;
  double d_TJM_d_Ug;
  double d_TJM_d_N;
  double d_TJM_d_AREA;
  double d_TJM_d_TJ;
  double d_TJM_d_TNOM;
  double KDURCHQ;
  double d_KDURCHQ_d_U;
  double d_KDURCHQ_d_Is;
  double d_KDURCHQ_d_Ug;
  double d_KDURCHQ_d_N;
  double d_KDURCHQ_d_AREA;
  double d_KDURCHQ_d_TJ;
  double d_KDURCHQ_d_TNOM;
  double lnIs;
  double d_lnIs_d_U;
  double d_lnIs_d_Is;
  double d_lnIs_d_Ug;
  double d_lnIs_d_N;
  double d_lnIs_d_AREA;
  double d_lnIs_d_TJ;
  double d_lnIs_d_TNOM;
  {
    d_VTH0_d_U=0.0;
    d_VTH0_d_Is=0.0;
    d_VTH0_d_Ug=0.0;
    d_VTH0_d_N=0.0;
    d_VTH0_d_AREA=0.0;
    d_VTH0_d_TJ=0.0;
    d_VTH0_d_TNOM=0.0;
    VTH0=adms_vt((20.0+273.15));
    d_VTHNOM_d_U=0.0;
    d_VTHNOM_d_Is=0.0;
    d_VTHNOM_d_Ug=0.0;
    d_VTHNOM_d_N=0.0;
    d_VTHNOM_d_AREA=0.0;
    d_VTHNOM_d_TJ=0.0;
    d_VTHNOM_d_TNOM=CONSTKoverQ;
    VTHNOM=adms_vt((TNOM+273.15));
    d_KDURCHQ_d_U=0.0;
    d_KDURCHQ_d_Is=0.0;
    d_KDURCHQ_d_Ug=0.0;
    d_KDURCHQ_d_N=0.0;
    d_KDURCHQ_d_AREA=0.0;
    d_KDURCHQ_d_TJ=0.0;
    d_KDURCHQ_d_TNOM=0.0;
    KDURCHQ=0.861708692e-4;
    d_lnIs_d_U=0.0;
    d_lnIs_d_Is=(1.0/(Is*AREA))*(AREA);
    d_lnIs_d_Ug=0.0;
    d_lnIs_d_N=0.0;
    d_lnIs_d_AREA=(1.0/(Is*AREA))*(Is);
    d_lnIs_d_TJ=0.0;
    d_lnIs_d_TNOM=0.0;
    lnIs=log((Is*AREA));
    d_maxi_d_U=0.0;
    d_maxi_d_Is=0.0;
    d_maxi_d_Ug=0.0;
    d_maxi_d_N=0.0;
    d_maxi_d_AREA=0.0;
    d_maxi_d_TJ=0.0;
    d_maxi_d_TNOM=0.0;
    maxi=log(1e6);
    if(((maxi<(Ug/VTHNOM))&&(U<0.0)))
    {
      d_Tmax_d_U=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_U)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_U)+((-((maxi*d_VTHNOM_d_U)+(d_maxi_d_U*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_Is=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_Is)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_Is)+((-((maxi*d_VTHNOM_d_Is)+(d_maxi_d_Is*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_Ug=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_Ug+VTHNOM)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_Ug)+((1.0-((maxi*d_VTHNOM_d_Ug)+(d_maxi_d_Ug*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_N=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_N)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_N)+((-((maxi*d_VTHNOM_d_N)+(d_maxi_d_N*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_AREA=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_AREA)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_AREA)+((-((maxi*d_VTHNOM_d_AREA)+(d_maxi_d_AREA*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_TJ=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_TJ)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_TJ)+((-((maxi*d_VTHNOM_d_TJ)+(d_maxi_d_TJ*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      d_Tmax_d_TNOM=((((Ug-(maxi*VTHNOM))*KDURCHQ)*(Ug*d_VTHNOM_d_TNOM)-(Ug*VTHNOM)*(((Ug-(maxi*VTHNOM))*d_KDURCHQ_d_TNOM)+((-((maxi*d_VTHNOM_d_TNOM)+(d_maxi_d_TNOM*VTHNOM)))*KDURCHQ)))/((Ug-(maxi*VTHNOM))*KDURCHQ)/((Ug-(maxi*VTHNOM))*KDURCHQ));
      Tmax=(((Ug*VTHNOM)/((Ug-(maxi*VTHNOM))*KDURCHQ))-273.15);
      d_TJM_d_U=d_Vt(TJ,Tmax,0.0,d_Tmax_d_U);
      d_TJM_d_Is=d_Vt(TJ,Tmax,0.0,d_Tmax_d_Is);
      d_TJM_d_Ug=d_Vt(TJ,Tmax,0.0,d_Tmax_d_Ug);
      d_TJM_d_N=d_Vt(TJ,Tmax,0.0,d_Tmax_d_N);
      d_TJM_d_AREA=d_Vt(TJ,Tmax,0.0,d_Tmax_d_AREA);
      d_TJM_d_TJ=d_Vt(TJ,Tmax,1.0,d_Tmax_d_TJ);
      d_TJM_d_TNOM=d_Vt(TJ,Tmax,0.0,d_Tmax_d_TNOM);
      TJM=Vt(TJ,Tmax);
    }
    else
    {
      d_TJM_d_U=0.0;
      d_TJM_d_Is=0.0;
      d_TJM_d_Ug=0.0;
      d_TJM_d_N=0.0;
      d_TJM_d_AREA=0.0;
      d_TJM_d_TJ=1.0;
      d_TJM_d_TNOM=0.0;
      TJM=TJ;
    }
    d_VTHJ_d_U=CONSTKoverQ*d_TJM_d_U;
    d_VTHJ_d_Is=CONSTKoverQ*d_TJM_d_Is;
    d_VTHJ_d_Ug=CONSTKoverQ*d_TJM_d_Ug;
    d_VTHJ_d_N=CONSTKoverQ*d_TJM_d_N;
    d_VTHJ_d_AREA=CONSTKoverQ*d_TJM_d_AREA;
    d_VTHJ_d_TJ=CONSTKoverQ*d_TJM_d_TJ;
    d_VTHJ_d_TNOM=CONSTKoverQ*d_TJM_d_TNOM;
    VTHJ=adms_vt((TJM+273.15));
    if((Ug>0.0))
    {
      d_diode_d_U=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((((N*VTHJ)-(U*(N*d_VTHJ_d_U)))/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_U/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_U/VTHJ/VTHJ))+d_lnIs_d_U))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_U/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_U/VTHJ/VTHJ))+d_lnIs_d_U)));
      d_diode_d_Is=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_Is)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_Is/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_Is/VTHJ/VTHJ))+d_lnIs_d_Is))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_Is/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_Is/VTHJ/VTHJ))+d_lnIs_d_Is)));
      d_diode_d_Ug=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_Ug)/(N*VTHJ)/(N*VTHJ))+((VTHNOM-(Ug*d_VTHNOM_d_Ug))/VTHNOM/VTHNOM))-((VTHJ-(Ug*d_VTHJ_d_Ug))/VTHJ/VTHJ))+d_lnIs_d_Ug))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),((((VTHNOM-(Ug*d_VTHNOM_d_Ug))/VTHNOM/VTHNOM)-((VTHJ-(Ug*d_VTHJ_d_Ug))/VTHJ/VTHJ))+d_lnIs_d_Ug)));
      d_diode_d_N=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_N+VTHJ)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_N/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_N/VTHJ/VTHJ))+d_lnIs_d_N))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_N/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_N/VTHJ/VTHJ))+d_lnIs_d_N)));
      d_diode_d_AREA=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_AREA)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_AREA/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_AREA/VTHJ/VTHJ))+d_lnIs_d_AREA))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_AREA/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_AREA/VTHJ/VTHJ))+d_lnIs_d_AREA)));
      d_diode_d_TJ=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_TJ)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_TJ/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_TJ/VTHJ/VTHJ))+d_lnIs_d_TJ))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_TJ/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_TJ/VTHJ/VTHJ))+d_lnIs_d_TJ)));
      d_diode_d_TNOM=(d_exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs),((((-U*(N*d_VTHJ_d_TNOM)/(N*VTHJ)/(N*VTHJ))+(-Ug*d_VTHNOM_d_TNOM/VTHNOM/VTHNOM))-(-Ug*d_VTHJ_d_TNOM/VTHJ/VTHJ))+d_lnIs_d_TNOM))-d_exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs),(((-Ug*d_VTHNOM_d_TNOM/VTHNOM/VTHNOM)-(-Ug*d_VTHJ_d_TNOM/VTHJ/VTHJ))+d_lnIs_d_TNOM)));
      diode=(exp_soft(((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs))-exp_soft((((Ug/VTHNOM)-(Ug/VTHJ))+lnIs)));
    }
    else
    {
      d_diode_d_U=d_exp_soft(((U/(N*VTH0))+lnIs),((((N*VTH0)-(U*(N*d_VTH0_d_U)))/(N*VTH0)/(N*VTH0))+d_lnIs_d_U));
      d_diode_d_Is=(d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_Is)/(N*VTH0)/(N*VTH0))+d_lnIs_d_Is))-(AREA));
      d_diode_d_Ug=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_Ug)/(N*VTH0)/(N*VTH0))+d_lnIs_d_Ug));
      d_diode_d_N=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_N+VTH0)/(N*VTH0)/(N*VTH0))+d_lnIs_d_N));
      d_diode_d_AREA=(d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_AREA)/(N*VTH0)/(N*VTH0))+d_lnIs_d_AREA))-(Is));
      d_diode_d_TJ=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_TJ)/(N*VTH0)/(N*VTH0))+d_lnIs_d_TJ));
      d_diode_d_TNOM=d_exp_soft(((U/(N*VTH0))+lnIs),((-U*(N*d_VTH0_d_TNOM)/(N*VTH0)/(N*VTH0))+d_lnIs_d_TNOM));
      diode=(exp_soft(((U/(N*VTH0))+lnIs))-(Is*AREA));
    }
  }
  // now save outputs and derivs into appropriate return vars
  diodeReturn.value=diode;
  diodeReturn.deriv_WRT_U = d_diode_d_U;
  diodeReturn.deriv_WRT_Is = d_diode_d_Is;
  diodeReturn.deriv_WRT_Ug = d_diode_d_Ug;
  diodeReturn.deriv_WRT_N = d_diode_d_N;
  diodeReturn.deriv_WRT_AREA = d_diode_d_AREA;
  diodeReturn.deriv_WRT_TJ = d_diode_d_TJ;
  diodeReturn.deriv_WRT_TNOM = d_diode_d_TNOM;
  return(diodeReturn);
}

// Derivative of Analog Function MM
double d_MM(double VBCI , double VCBO , double MC , double VCBLIN , double BF , double KC  , double d_VBCI , double d_VCBO , double d_MC , double d_VCBLIN , double d_BF , double d_KC )
{
  // Function return variable and total deriv
  double MM;
  double d_MM;
  // Derivatives of return value w.r.t input vars
  double d_MM_d_VBCI;
  double d_MM_d_VCBO;
  double d_MM_d_MC;
  double d_MM_d_VCBLIN;
  double d_MM_d_BF;
  double d_MM_d_KC;
  double FBD;
  double d_FBD_d_VBCI;
  double d_FBD_d_VCBO;
  double d_FBD_d_MC;
  double d_FBD_d_VCBLIN;
  double d_FBD_d_BF;
  double d_FBD_d_KC;
  double vcbi;
  double d_vcbi_d_VBCI;
  double d_vcbi_d_VCBO;
  double d_vcbi_d_MC;
  double d_vcbi_d_VCBLIN;
  double d_vcbi_d_BF;
  double d_vcbi_d_KC;
  {
    if((((KC>0.0)&&(MC>0.0))&&(VCBO>0.0)))
    {
      d_vcbi_d_VBCI=1.0;
      d_vcbi_d_VCBO=0.0;
      d_vcbi_d_MC=0.0;
      d_vcbi_d_VCBLIN=0.0;
      d_vcbi_d_BF=0.0;
      d_vcbi_d_KC=0.0;
      vcbi=VBCI;
      d_FBD_d_VBCI=0.0;
      d_FBD_d_VCBO=(-VCBLIN/VCBO/VCBO);
      d_FBD_d_MC=0.0;
      d_FBD_d_VCBLIN=(1.0/VCBO);
      d_FBD_d_BF=0.0;
      d_FBD_d_KC=0.0;
      FBD=(VCBLIN/VCBO);
      if((VBCI>0.0))
      {
        d_MM_d_VBCI=0.0;
        d_MM_d_VCBO=0.0;
        d_MM_d_MC=0.0;
        d_MM_d_VCBLIN=0.0;
        d_MM_d_BF=0.0;
        d_MM_d_KC=0.0;
        MM=1.0;
      }
      else
      {
        if((VBCI>(-VCBLIN)))
        {
          if((MC==1))
          {
            d_MM_d_VBCI=(-(-(d_vcbi_d_VBCI/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_VCBO=(-(-(((-VCBO)*d_vcbi_d_VCBO-vcbi*(-1.0))/(-VCBO)/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_MC=(-(-(d_vcbi_d_MC/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_VCBLIN=(-(-(d_vcbi_d_VCBLIN/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_BF=(-(-(d_vcbi_d_BF/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_KC=(-(-(d_vcbi_d_KC/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            MM=(1.0/(1.0-(vcbi/(-VCBO))));
          }
          else
          {
            d_MM_d_VBCI=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_VBCI/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_VCBO=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(((-VCBO)*d_vcbi_d_VCBO-vcbi*(-1.0))/(-VCBO)/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_MC=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_MC/(-VCBO))+(((vcbi/(-VCBO))==0.0)?0.0:(log((vcbi/(-VCBO))*pow((vcbi/(-VCBO)),MC)))))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_VCBLIN=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_VCBLIN/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_BF=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_BF/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_KC=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_KC/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            MM=(1.0/(1.0-pow((vcbi/(-VCBO)),MC)));
          }
        }
        else
        {
          if((VBCI<=(-VCBLIN)))
          {
            if((MC==1))
            {
              d_MM_d_VBCI=((-(-d_FBD_d_VBCI)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VBCI+(d_FBD_d_VBCI*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VBCI)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBO=((-(-d_FBD_d_VCBO)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VCBO+(FBD+VCBO*d_FBD_d_VCBO)))+(((pow((1.0-FBD),2.0)*((-1.0/VCBO/VCBO)*1.0)-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VCBO))/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_MC=((-(-d_FBD_d_MC)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_MC+(d_FBD_d_MC*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_MC)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBLIN=((-(-d_FBD_d_VCBLIN)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VCBLIN+(d_FBD_d_VCBLIN*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VCBLIN)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_BF=((-(-d_FBD_d_BF)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_BF+(d_FBD_d_BF*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_BF)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_KC=((-(-d_FBD_d_KC)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_KC+(d_FBD_d_KC*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_KC)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              MM=((1.0/(1.0-FBD))-((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO))));
            }
            else
            {
              d_MM_d_VBCI=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VBCI)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VBCI+(d_FBD_d_VBCI*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VBCI)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VBCI))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBO=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBO)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VCBO+(FBD+VCBO*d_FBD_d_VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*(((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VCBO)+((-MC/VCBO/VCBO)*pow(FBD,(MC-1.0))))-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBO))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_MC=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,MC)))))/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_MC+(d_FBD_d_MC*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*(((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,(MC-1.0))))))+((1.0/VCBO)*pow(FBD,(MC-1.0))))-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,MC))))))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBLIN=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBLIN)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VCBLIN+(d_FBD_d_VCBLIN*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VCBLIN)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBLIN))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_BF=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_BF)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_BF+(d_FBD_d_BF*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_BF)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_BF))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_KC=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_KC)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_KC+(d_FBD_d_KC*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_KC)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_KC))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              MM=((1.0/(1.0-pow(FBD,MC)))-((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO))));
            }
          }
        }
      }
    }
    else
    {
      d_MM_d_VBCI=0.0;
      d_MM_d_VCBO=0.0;
      d_MM_d_MC=0.0;
      d_MM_d_VCBLIN=0.0;
      d_MM_d_BF=0.0;
      d_MM_d_KC=0.0;
      MM=1.0;
    }
  }
  d_MM = d_MM_d_VBCI*d_VBCI+d_MM_d_VCBO*d_VCBO+d_MM_d_MC*d_MC+d_MM_d_VCBLIN*d_VCBLIN+d_MM_d_BF*d_BF+d_MM_d_KC*d_KC;
  return(d_MM);
}

// Evaluator class implementations for Analog Function MM
// Constructor
MMEvaluator::MMEvaluator(double VBCI, double VCBO, double MC, double VCBLIN, double BF, double KC)
{
  MMReturn_ = evaluator_(VBCI, VCBO, MC, VCBLIN, BF, KC);
}
// method to get precomputed values into double vars 
double MMEvaluator::getValues(double  VBCI, double  VCBO, double  MC, double  VCBLIN, double  BF, double  KC)
{
  // Silence unused argument warnings
  (void) VBCI;
  (void) VCBO;
  (void) MC;
  (void) VCBLIN;
  (void) BF;
  (void) KC;
  // Copy all precomputed values into corresponding output
  return(MMReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double MMEvaluator::getDerivs(double VBCI , double VCBO , double MC , double VCBLIN , double BF , double KC  , double d_VBCI, double d_VCBO, double d_MC, double d_VCBLIN, double d_BF, double d_KC)
{
  // Function total deriv
  double d_MM;
  // Silence unused argument warnings
  (void) VBCI;
  (void) VCBO;
  (void) MC;
  (void) VCBLIN;
  (void) BF;
  (void) KC;
  d_MM = MMReturn_.deriv_WRT_VBCI*d_VBCI+MMReturn_.deriv_WRT_VCBO*d_VCBO+MMReturn_.deriv_WRT_MC*d_MC+MMReturn_.deriv_WRT_VCBLIN*d_VCBLIN+MMReturn_.deriv_WRT_BF*d_BF+MMReturn_.deriv_WRT_KC*d_KC;
  return(d_MM);
}
// method that actually performs our computations.
MMEvaluator::returnType MMEvaluator::evaluator_(double VBCI, double VCBO, double MC, double VCBLIN, double BF, double KC)
{
  // Function value and derivs variables, and a returnType to store everything
  double MM;
  MMEvaluator::returnType MMReturn;
  // Derivatives of return value w.r.t input vars
  double d_MM_d_VBCI;
  double d_MM_d_VCBO;
  double d_MM_d_MC;
  double d_MM_d_VCBLIN;
  double d_MM_d_BF;
  double d_MM_d_KC;
  // declared local variables
  double FBD;
  double d_FBD_d_VBCI;
  double d_FBD_d_VCBO;
  double d_FBD_d_MC;
  double d_FBD_d_VCBLIN;
  double d_FBD_d_BF;
  double d_FBD_d_KC;
  double vcbi;
  double d_vcbi_d_VBCI;
  double d_vcbi_d_VCBO;
  double d_vcbi_d_MC;
  double d_vcbi_d_VCBLIN;
  double d_vcbi_d_BF;
  double d_vcbi_d_KC;
  {
    if((((KC>0.0)&&(MC>0.0))&&(VCBO>0.0)))
    {
      d_vcbi_d_VBCI=1.0;
      d_vcbi_d_VCBO=0.0;
      d_vcbi_d_MC=0.0;
      d_vcbi_d_VCBLIN=0.0;
      d_vcbi_d_BF=0.0;
      d_vcbi_d_KC=0.0;
      vcbi=VBCI;
      d_FBD_d_VBCI=0.0;
      d_FBD_d_VCBO=(-VCBLIN/VCBO/VCBO);
      d_FBD_d_MC=0.0;
      d_FBD_d_VCBLIN=(1.0/VCBO);
      d_FBD_d_BF=0.0;
      d_FBD_d_KC=0.0;
      FBD=(VCBLIN/VCBO);
      if((VBCI>0.0))
      {
        d_MM_d_VBCI=0.0;
        d_MM_d_VCBO=0.0;
        d_MM_d_MC=0.0;
        d_MM_d_VCBLIN=0.0;
        d_MM_d_BF=0.0;
        d_MM_d_KC=0.0;
        MM=1.0;
      }
      else
      {
        if((VBCI>(-VCBLIN)))
        {
          if((MC==1))
          {
            d_MM_d_VBCI=(-(-(d_vcbi_d_VBCI/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_VCBO=(-(-(((-VCBO)*d_vcbi_d_VCBO-vcbi*(-1.0))/(-VCBO)/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_MC=(-(-(d_vcbi_d_MC/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_VCBLIN=(-(-(d_vcbi_d_VCBLIN/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_BF=(-(-(d_vcbi_d_BF/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            d_MM_d_KC=(-(-(d_vcbi_d_KC/(-VCBO)))/(1.0-(vcbi/(-VCBO)))/(1.0-(vcbi/(-VCBO))));
            MM=(1.0/(1.0-(vcbi/(-VCBO))));
          }
          else
          {
            d_MM_d_VBCI=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_VBCI/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_VCBO=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(((-VCBO)*d_vcbi_d_VCBO-vcbi*(-1.0))/(-VCBO)/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_MC=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_MC/(-VCBO))+(((vcbi/(-VCBO))==0.0)?0.0:(log((vcbi/(-VCBO))*pow((vcbi/(-VCBO)),MC)))))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_VCBLIN=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_VCBLIN/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_BF=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_BF/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            d_MM_d_KC=(-(-(((vcbi/(-VCBO))==0.0)?0.0:(pow((vcbi/(-VCBO)),MC)*MC/(vcbi/(-VCBO))))*(d_vcbi_d_KC/(-VCBO)))/(1.0-pow((vcbi/(-VCBO)),MC))/(1.0-pow((vcbi/(-VCBO)),MC)));
            MM=(1.0/(1.0-pow((vcbi/(-VCBO)),MC)));
          }
        }
        else
        {
          if((VBCI<=(-VCBLIN)))
          {
            if((MC==1))
            {
              d_MM_d_VBCI=((-(-d_FBD_d_VBCI)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VBCI+(d_FBD_d_VBCI*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VBCI)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBO=((-(-d_FBD_d_VCBO)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VCBO+(FBD+VCBO*d_FBD_d_VCBO)))+(((pow((1.0-FBD),2.0)*((-1.0/VCBO/VCBO)*1.0)-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VCBO))/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_MC=((-(-d_FBD_d_MC)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_MC+(d_FBD_d_MC*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_MC)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBLIN=((-(-d_FBD_d_VCBLIN)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_VCBLIN+(d_FBD_d_VCBLIN*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_VCBLIN)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_BF=((-(-d_FBD_d_BF)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_BF+(d_FBD_d_BF*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_BF)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_KC=((-(-d_FBD_d_KC)/(1.0-FBD)/(1.0-FBD))-(((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(d_vcbi_d_KC+(d_FBD_d_KC*VCBO)))+((-((1.0/VCBO)*1.0)*(((1.0-FBD)==0.0)?0.0:(pow((1.0-FBD),2.0)*2.0/(1.0-FBD)))*(-d_FBD_d_KC)/pow((1.0-FBD),2.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO)))));
              MM=((1.0/(1.0-FBD))-((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO))));
            }
            else
            {
              d_MM_d_VBCI=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VBCI)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VBCI+(d_FBD_d_VBCI*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VBCI)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VBCI))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBO=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBO)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VCBO+(FBD+VCBO*d_FBD_d_VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*(((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VCBO)+((-MC/VCBO/VCBO)*pow(FBD,(MC-1.0))))-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBO))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_MC=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,MC)))))/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_MC+(d_FBD_d_MC*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*(((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,(MC-1.0))))))+((1.0/VCBO)*pow(FBD,(MC-1.0))))-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_MC+((FBD==0.0)?0.0:(log(FBD*pow(FBD,MC))))))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_VCBLIN=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBLIN)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_VCBLIN+(d_FBD_d_VCBLIN*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_VCBLIN)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_VCBLIN))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_BF=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_BF)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_BF+(d_FBD_d_BF*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_BF)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_BF))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              d_MM_d_KC=((-(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_KC)/(1.0-pow(FBD,MC))/(1.0-pow(FBD,MC)))-(((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(d_vcbi_d_KC+(d_FBD_d_KC*VCBO)))+(((pow((1.0-pow(FBD,MC)),2.0)*((MC/VCBO)*((FBD==0.0)?0.0:(pow(FBD,(MC-1.0))*(MC-1.0)/FBD))*d_FBD_d_KC)-((MC/VCBO)*pow(FBD,(MC-1.0)))*(((1.0-pow(FBD,MC))==0.0)?0.0:(pow((1.0-pow(FBD,MC)),2.0)*2.0/(1.0-pow(FBD,MC))))*(-((FBD==0.0)?0.0:(pow(FBD,MC)*MC/FBD))*d_FBD_d_KC))/pow((1.0-pow(FBD,MC)),2.0)/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO)))));
              MM=((1.0/(1.0-pow(FBD,MC)))-((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO))));
            }
          }
        }
      }
    }
    else
    {
      d_MM_d_VBCI=0.0;
      d_MM_d_VCBO=0.0;
      d_MM_d_MC=0.0;
      d_MM_d_VCBLIN=0.0;
      d_MM_d_BF=0.0;
      d_MM_d_KC=0.0;
      MM=1.0;
    }
  }
  // now save outputs and derivs into appropriate return vars
  MMReturn.value=MM;
  MMReturn.deriv_WRT_VBCI = d_MM_d_VBCI;
  MMReturn.deriv_WRT_VCBO = d_MM_d_VCBO;
  MMReturn.deriv_WRT_MC = d_MM_d_MC;
  MMReturn.deriv_WRT_VCBLIN = d_MM_d_VCBLIN;
  MMReturn.deriv_WRT_BF = d_MM_d_BF;
  MMReturn.deriv_WRT_KC = d_MM_d_KC;
  return(MMReturn);
}

// Derivative of Analog Function charge
double d_charge(double U , double C0 , double Ud , double m , double Area  , double d_U , double d_C0 , double d_Ud , double d_m , double d_Area )
{
  // Function return variable and total deriv
  double charge;
  double d_charge;
  // Derivatives of return value w.r.t input vars
  double d_charge_d_U;
  double d_charge_d_C0;
  double d_charge_d_Ud;
  double d_charge_d_m;
  double d_charge_d_Area;
  double Vj;
  double d_Vj_d_U;
  double d_Vj_d_C0;
  double d_Vj_d_Ud;
  double d_Vj_d_m;
  double d_Vj_d_Area;
  double Vjo;
  double d_Vjo_d_U;
  double d_Vjo_d_C0;
  double d_Vjo_d_Ud;
  double d_Vjo_d_m;
  double d_Vjo_d_Area;
  double VF;
  double d_VF_d_U;
  double d_VF_d_C0;
  double d_VF_d_Ud;
  double d_VF_d_m;
  double d_VF_d_Area;
  {
    d_Vj_d_U=d_Vt(U,Ud,1.0,0.0);
    d_Vj_d_C0=0.0;
    d_Vj_d_Ud=d_Vt(U,Ud,0.0,1.0);
    d_Vj_d_m=0.0;
    d_Vj_d_Area=0.0;
    Vj=Vt(U,Ud);
    d_Vjo_d_U=0.0;
    d_Vjo_d_C0=0.0;
    d_Vjo_d_Ud=d_Vt( static_cast<double>(0.0),Ud,0.0,1.0);
    d_Vjo_d_m=0.0;
    d_Vjo_d_Area=0.0;
    Vjo=Vt( static_cast<double>(0.0),Ud);
    d_VF_d_U=0.0;
    d_VF_d_C0=0.0;
    d_VF_d_Ud=(0.9);
    d_VF_d_m=0.0;
    d_VF_d_Area=0.0;
    VF=(0.9*Ud);
    if((m==1.0))
    {
      d_charge_d_U=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_U/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_U/Ud))))+(((1.0/(1.0-(VF/Ud)))*((1.0-d_Vj_d_U)+d_Vjo_d_U))+((-(-(d_VF_d_U/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_C0=(((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_C0/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_C0/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_C0)+d_Vjo_d_C0))+((-(-(d_VF_d_C0/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))))+((Area)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_Ud=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-((Ud*d_Vjo_d_Ud-Vjo)/Ud/Ud))-(1.0/(1.0-(Vj/Ud)))*(-((Ud*d_Vj_d_Ud-Vj)/Ud/Ud)))+(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_Ud)+d_Vjo_d_Ud))+((-(-((Ud*d_VF_d_Ud-VF)/Ud/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_m=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_m/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_m/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_m)+d_Vjo_d_m))+((-(-(d_VF_d_m/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_Area=(((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_Area/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_Area/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_Area)+d_Vjo_d_Area))+((-(-(d_VF_d_Area/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))))+((C0)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      charge=((Area*C0)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo))));
    }
    else
    {
      d_charge_d_U=((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_U/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_U/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((1.0-d_Vj_d_U)+d_Vjo_d_U))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_U/Ud))*((U-Vj)+Vjo)))));
      d_charge_d_C0=(((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_C0/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_C0/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_C0)+d_Vjo_d_C0))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_C0/Ud))*((U-Vj)+Vjo)))))+((Area)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m))))));
      d_charge_d_Ud=((Area*C0)*(((((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-((Ud*d_Vjo_d_Ud-Vjo)/Ud/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-((Ud*d_Vj_d_Ud-Vj)/Ud/Ud))))+((1.0/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m)))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_Ud)+d_Vjo_d_Ud))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-((Ud*d_VF_d_Ud-VF)/Ud/Ud))*((U-Vj)+Vjo))))-((1.0/(1.0-m)))));
      d_charge_d_m=((Area*C0)*(((((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_m/Ud))+(((1.0-(Vjo/Ud))==0.0)?0.0:(log((1.0-(Vjo/Ud))*pow((1.0-(Vjo/Ud)),(1.0-m)))))*(-1.0)-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_m/Ud))+(((1.0-(Vj/Ud))==0.0)?0.0:(log((1.0-(Vj/Ud))*pow((1.0-(Vj/Ud)),(1.0-m)))))*(-1.0)))+((-Ud*(-1.0)/(1.0-m)/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m)))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_m)+d_Vjo_d_m))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_m/Ud))+(((1.0-(VF/Ud))==0.0)?0.0:(log((1.0-(VF/Ud))*pow((1.0-(VF/Ud)),(-m)))))*(-1.0)*((U-Vj)+Vjo))))-(Ud*(-(-1.0)/(1.0-m)/(1.0-m)))));
      d_charge_d_Area=(((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_Area/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_Area/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_Area)+d_Vjo_d_Area))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_Area/Ud))*((U-Vj)+Vjo)))))+((C0)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m))))));
      charge=((Area*C0)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m)))));
    }
  }
  d_charge = d_charge_d_U*d_U+d_charge_d_C0*d_C0+d_charge_d_Ud*d_Ud+d_charge_d_m*d_m+d_charge_d_Area*d_Area;
  return(d_charge);
}

// Evaluator class implementations for Analog Function charge
// Constructor
chargeEvaluator::chargeEvaluator(double U, double C0, double Ud, double m, double Area)
{
  chargeReturn_ = evaluator_(U, C0, Ud, m, Area);
}
// method to get precomputed values into double vars 
double chargeEvaluator::getValues(double  U, double  C0, double  Ud, double  m, double  Area)
{
  // Silence unused argument warnings
  (void) U;
  (void) C0;
  (void) Ud;
  (void) m;
  (void) Area;
  // Copy all precomputed values into corresponding output
  return(chargeReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double chargeEvaluator::getDerivs(double U , double C0 , double Ud , double m , double Area  , double d_U, double d_C0, double d_Ud, double d_m, double d_Area)
{
  // Function total deriv
  double d_charge;
  // Silence unused argument warnings
  (void) U;
  (void) C0;
  (void) Ud;
  (void) m;
  (void) Area;
  d_charge = chargeReturn_.deriv_WRT_U*d_U+chargeReturn_.deriv_WRT_C0*d_C0+chargeReturn_.deriv_WRT_Ud*d_Ud+chargeReturn_.deriv_WRT_m*d_m+chargeReturn_.deriv_WRT_Area*d_Area;
  return(d_charge);
}
// method that actually performs our computations.
chargeEvaluator::returnType chargeEvaluator::evaluator_(double U, double C0, double Ud, double m, double Area)
{
  // Function value and derivs variables, and a returnType to store everything
  double charge;
  chargeEvaluator::returnType chargeReturn;
  // Derivatives of return value w.r.t input vars
  double d_charge_d_U;
  double d_charge_d_C0;
  double d_charge_d_Ud;
  double d_charge_d_m;
  double d_charge_d_Area;
  // declared local variables
  double Vj;
  double d_Vj_d_U;
  double d_Vj_d_C0;
  double d_Vj_d_Ud;
  double d_Vj_d_m;
  double d_Vj_d_Area;
  double Vjo;
  double d_Vjo_d_U;
  double d_Vjo_d_C0;
  double d_Vjo_d_Ud;
  double d_Vjo_d_m;
  double d_Vjo_d_Area;
  double VF;
  double d_VF_d_U;
  double d_VF_d_C0;
  double d_VF_d_Ud;
  double d_VF_d_m;
  double d_VF_d_Area;
  {
    d_Vj_d_U=d_Vt(U,Ud,1.0,0.0);
    d_Vj_d_C0=0.0;
    d_Vj_d_Ud=d_Vt(U,Ud,0.0,1.0);
    d_Vj_d_m=0.0;
    d_Vj_d_Area=0.0;
    Vj=Vt(U,Ud);
    d_Vjo_d_U=0.0;
    d_Vjo_d_C0=0.0;
    d_Vjo_d_Ud=d_Vt( static_cast<double>(0.0),Ud,0.0,1.0);
    d_Vjo_d_m=0.0;
    d_Vjo_d_Area=0.0;
    Vjo=Vt( static_cast<double>(0.0),Ud);
    d_VF_d_U=0.0;
    d_VF_d_C0=0.0;
    d_VF_d_Ud=(0.9);
    d_VF_d_m=0.0;
    d_VF_d_Area=0.0;
    VF=(0.9*Ud);
    if((m==1.0))
    {
      d_charge_d_U=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_U/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_U/Ud))))+(((1.0/(1.0-(VF/Ud)))*((1.0-d_Vj_d_U)+d_Vjo_d_U))+((-(-(d_VF_d_U/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_C0=(((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_C0/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_C0/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_C0)+d_Vjo_d_C0))+((-(-(d_VF_d_C0/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))))+((Area)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_Ud=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-((Ud*d_Vjo_d_Ud-Vjo)/Ud/Ud))-(1.0/(1.0-(Vj/Ud)))*(-((Ud*d_Vj_d_Ud-Vj)/Ud/Ud)))+(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_Ud)+d_Vjo_d_Ud))+((-(-((Ud*d_VF_d_Ud-VF)/Ud/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_m=((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_m/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_m/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_m)+d_Vjo_d_m))+((-(-(d_VF_d_m/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      d_charge_d_Area=(((Area*C0)*((Ud*((1.0/(1.0-(Vjo/Ud)))*(-(d_Vjo_d_Area/Ud))-(1.0/(1.0-(Vj/Ud)))*(-(d_Vj_d_Area/Ud))))+(((1.0/(1.0-(VF/Ud)))*((-d_Vj_d_Area)+d_Vjo_d_Area))+((-(-(d_VF_d_Area/Ud))/(1.0-(VF/Ud))/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))))+((C0)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo)))));
      charge=((Area*C0)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo))));
    }
    else
    {
      d_charge_d_U=((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_U/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_U/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((1.0-d_Vj_d_U)+d_Vjo_d_U))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_U/Ud))*((U-Vj)+Vjo)))));
      d_charge_d_C0=(((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_C0/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_C0/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_C0)+d_Vjo_d_C0))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_C0/Ud))*((U-Vj)+Vjo)))))+((Area)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m))))));
      d_charge_d_Ud=((Area*C0)*(((((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-((Ud*d_Vjo_d_Ud-Vjo)/Ud/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-((Ud*d_Vj_d_Ud-Vj)/Ud/Ud))))+((1.0/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m)))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_Ud)+d_Vjo_d_Ud))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-((Ud*d_VF_d_Ud-VF)/Ud/Ud))*((U-Vj)+Vjo))))-((1.0/(1.0-m)))));
      d_charge_d_m=((Area*C0)*(((((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_m/Ud))+(((1.0-(Vjo/Ud))==0.0)?0.0:(log((1.0-(Vjo/Ud))*pow((1.0-(Vjo/Ud)),(1.0-m)))))*(-1.0)-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_m/Ud))+(((1.0-(Vj/Ud))==0.0)?0.0:(log((1.0-(Vj/Ud))*pow((1.0-(Vj/Ud)),(1.0-m)))))*(-1.0)))+((-Ud*(-1.0)/(1.0-m)/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m)))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_m)+d_Vjo_d_m))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_m/Ud))+(((1.0-(VF/Ud))==0.0)?0.0:(log((1.0-(VF/Ud))*pow((1.0-(VF/Ud)),(-m)))))*(-1.0)*((U-Vj)+Vjo))))-(Ud*(-(-1.0)/(1.0-m)/(1.0-m)))));
      d_charge_d_Area=(((Area*C0)*(((Ud/(1.0-m))*((((1.0-(Vjo/Ud))==0.0)?0.0:(pow((1.0-(Vjo/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vjo/Ud))))*(-(d_Vjo_d_Area/Ud))-(((1.0-(Vj/Ud))==0.0)?0.0:(pow((1.0-(Vj/Ud)),(1.0-m))*(1.0-m)/(1.0-(Vj/Ud))))*(-(d_Vj_d_Area/Ud))))+((pow((1.0-(VF/Ud)),(-m))*((-d_Vj_d_Area)+d_Vjo_d_Area))+((((1.0-(VF/Ud))==0.0)?0.0:(pow((1.0-(VF/Ud)),(-m))*(-m)/(1.0-(VF/Ud))))*(-(d_VF_d_Area/Ud))*((U-Vj)+Vjo)))))+((C0)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m))))));
      charge=((Area*C0)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m)))));
    }
  }
  // now save outputs and derivs into appropriate return vars
  chargeReturn.value=charge;
  chargeReturn.deriv_WRT_U = d_charge_d_U;
  chargeReturn.deriv_WRT_C0 = d_charge_d_C0;
  chargeReturn.deriv_WRT_Ud = d_charge_d_Ud;
  chargeReturn.deriv_WRT_m = d_charge_d_m;
  chargeReturn.deriv_WRT_Area = d_charge_d_Area;
  return(chargeReturn);
}

// Derivative of Analog Function Vceff
double d_Vceff(double U , double VCES  , double d_U , double d_VCES )
{
  // Function return variable and total deriv
  double Vceff;
  double d_Vceff;
  // Derivatives of return value w.r.t input vars
  double d_Vceff_d_U;
  double d_Vceff_d_VCES;
  double Vth0;
  double d_Vth0_d_U;
  double d_Vth0_d_VCES;
  {
    d_Vth0_d_U=0.0;
    d_Vth0_d_VCES=0.0;
    Vth0=0.025;
    if((U<VCES))
    {
      d_Vceff_d_U=(d_Vth0_d_U+((Vth0*(1.0/(1.0+exp((((U-VCES)/Vth0)-1.0))))*exp((((U-VCES)/Vth0)-1.0))*((Vth0-((U-VCES)*d_Vth0_d_U))/Vth0/Vth0))+(d_Vth0_d_U*log((1.0+exp((((U-VCES)/Vth0)-1.0)))))));
      d_Vceff_d_VCES=(d_Vth0_d_VCES+((Vth0*(1.0/(1.0+exp((((U-VCES)/Vth0)-1.0))))*exp((((U-VCES)/Vth0)-1.0))*((Vth0*(-1.0)-(U-VCES)*d_Vth0_d_VCES)/Vth0/Vth0))+(d_Vth0_d_VCES*log((1.0+exp((((U-VCES)/Vth0)-1.0)))))));
      Vceff=(Vth0+(Vth0*log((1.0+exp((((U-VCES)/Vth0)-1.0))))));
    }
    else
    {
      d_Vceff_d_U=(1.0+((Vth0*(1.0/(1.0+exp((1.0-((U-VCES)/Vth0)))))*exp((1.0-((U-VCES)/Vth0)))*(-((Vth0-((U-VCES)*d_Vth0_d_U))/Vth0/Vth0)))+(d_Vth0_d_U*log((1.0+exp((1.0-((U-VCES)/Vth0))))))));
      d_Vceff_d_VCES=((-1.0)+((Vth0*(1.0/(1.0+exp((1.0-((U-VCES)/Vth0)))))*exp((1.0-((U-VCES)/Vth0)))*(-((Vth0*(-1.0)-(U-VCES)*d_Vth0_d_VCES)/Vth0/Vth0)))+(d_Vth0_d_VCES*log((1.0+exp((1.0-((U-VCES)/Vth0))))))));
      Vceff=((U-VCES)+(Vth0*log((1.0+exp((1.0-((U-VCES)/Vth0)))))));
    }
  }
  d_Vceff = d_Vceff_d_U*d_U+d_Vceff_d_VCES*d_VCES;
  return(d_Vceff);
}

// Evaluator class implementations for Analog Function Vceff
// Constructor
VceffEvaluator::VceffEvaluator(double U, double VCES)
{
  VceffReturn_ = evaluator_(U, VCES);
}
// method to get precomputed values into double vars 
double VceffEvaluator::getValues(double  U, double  VCES)
{
  // Silence unused argument warnings
  (void) U;
  (void) VCES;
  // Copy all precomputed values into corresponding output
  return(VceffReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double VceffEvaluator::getDerivs(double U , double VCES  , double d_U, double d_VCES)
{
  // Function total deriv
  double d_Vceff;
  // Silence unused argument warnings
  (void) U;
  (void) VCES;
  d_Vceff = VceffReturn_.deriv_WRT_U*d_U+VceffReturn_.deriv_WRT_VCES*d_VCES;
  return(d_Vceff);
}
// method that actually performs our computations.
VceffEvaluator::returnType VceffEvaluator::evaluator_(double U, double VCES)
{
  // Function value and derivs variables, and a returnType to store everything
  double Vceff;
  VceffEvaluator::returnType VceffReturn;
  // Derivatives of return value w.r.t input vars
  double d_Vceff_d_U;
  double d_Vceff_d_VCES;
  // declared local variables
  double Vth0;
  double d_Vth0_d_U;
  double d_Vth0_d_VCES;
  {
    d_Vth0_d_U=0.0;
    d_Vth0_d_VCES=0.0;
    Vth0=0.025;
    if((U<VCES))
    {
      d_Vceff_d_U=(d_Vth0_d_U+((Vth0*(1.0/(1.0+exp((((U-VCES)/Vth0)-1.0))))*exp((((U-VCES)/Vth0)-1.0))*((Vth0-((U-VCES)*d_Vth0_d_U))/Vth0/Vth0))+(d_Vth0_d_U*log((1.0+exp((((U-VCES)/Vth0)-1.0)))))));
      d_Vceff_d_VCES=(d_Vth0_d_VCES+((Vth0*(1.0/(1.0+exp((((U-VCES)/Vth0)-1.0))))*exp((((U-VCES)/Vth0)-1.0))*((Vth0*(-1.0)-(U-VCES)*d_Vth0_d_VCES)/Vth0/Vth0))+(d_Vth0_d_VCES*log((1.0+exp((((U-VCES)/Vth0)-1.0)))))));
      Vceff=(Vth0+(Vth0*log((1.0+exp((((U-VCES)/Vth0)-1.0))))));
    }
    else
    {
      d_Vceff_d_U=(1.0+((Vth0*(1.0/(1.0+exp((1.0-((U-VCES)/Vth0)))))*exp((1.0-((U-VCES)/Vth0)))*(-((Vth0-((U-VCES)*d_Vth0_d_U))/Vth0/Vth0)))+(d_Vth0_d_U*log((1.0+exp((1.0-((U-VCES)/Vth0))))))));
      d_Vceff_d_VCES=((-1.0)+((Vth0*(1.0/(1.0+exp((1.0-((U-VCES)/Vth0)))))*exp((1.0-((U-VCES)/Vth0)))*(-((Vth0*(-1.0)-(U-VCES)*d_Vth0_d_VCES)/Vth0/Vth0)))+(d_Vth0_d_VCES*log((1.0+exp((1.0-((U-VCES)/Vth0))))))));
      Vceff=((U-VCES)+(Vth0*log((1.0+exp((1.0-((U-VCES)/Vth0)))))));
    }
  }
  // now save outputs and derivs into appropriate return vars
  VceffReturn.value=Vceff;
  VceffReturn.deriv_WRT_U = d_Vceff_d_U;
  VceffReturn.deriv_WRT_VCES = d_Vceff_d_VCES;
  return(VceffReturn);
}

// Derivative of Analog Function ICK
double d_ICK(double U , double RCI0 , double VLIM , double InvVPT , double VCES  , double d_U , double d_RCI0 , double d_VLIM , double d_InvVPT , double d_VCES )
{
  // Function return variable and total deriv
  double ICK;
  double d_ICK;
  // Derivatives of return value w.r.t input vars
  double d_ICK_d_U;
  double d_ICK_d_RCI0;
  double d_ICK_d_VLIM;
  double d_ICK_d_InvVPT;
  double d_ICK_d_VCES;
  double VC;
  double d_VC_d_U;
  double d_VC_d_RCI0;
  double d_VC_d_VLIM;
  double d_VC_d_InvVPT;
  double d_VC_d_VCES;
  double x;
  double d_x_d_U;
  double d_x_d_RCI0;
  double d_x_d_VLIM;
  double d_x_d_InvVPT;
  double d_x_d_VCES;
  {
    d_VC_d_U=d_Vceff(U,VCES,1.0,0.0);
    d_VC_d_RCI0=0.0;
    d_VC_d_VLIM=0.0;
    d_VC_d_InvVPT=0.0;
    d_VC_d_VCES=d_Vceff(U,VCES,0.0,1.0);
    VC=Vceff(U,VCES);
    d_x_d_U=(d_VC_d_U*InvVPT);
    d_x_d_RCI0=(d_VC_d_RCI0*InvVPT);
    d_x_d_VLIM=((d_VC_d_VLIM-1.0)*InvVPT);
    d_x_d_InvVPT=((VC-VLIM)+InvVPT*d_VC_d_InvVPT);
    d_x_d_VCES=(d_VC_d_VCES*InvVPT);
    x=((VC-VLIM)*InvVPT);
    d_ICK_d_U=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_U+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_U)+(d_x_d_U*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_U/VLIM))+((d_VC_d_U/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_U/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_RCI0=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_RCI0+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_RCI0)+(d_x_d_RCI0*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_RCI0/VLIM))+((d_VC_d_RCI0/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+(((RCI0*d_VC_d_RCI0-VC)/RCI0/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_VLIM=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_VLIM+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_VLIM)+(d_x_d_VLIM*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*((VLIM*d_VC_d_VLIM-VC)/VLIM/VLIM))+(((VLIM*d_VC_d_VLIM-VC)/VLIM/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_VLIM/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_InvVPT=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_InvVPT+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_InvVPT)+(d_x_d_InvVPT*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_InvVPT/VLIM))+((d_VC_d_InvVPT/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_InvVPT/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_VCES=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_VCES+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_VCES)+(d_x_d_VCES*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_VCES/VLIM))+((d_VC_d_VCES/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_VCES/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    ICK=(((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0)));
  }
  d_ICK = d_ICK_d_U*d_U+d_ICK_d_RCI0*d_RCI0+d_ICK_d_VLIM*d_VLIM+d_ICK_d_InvVPT*d_InvVPT+d_ICK_d_VCES*d_VCES;
  return(d_ICK);
}

// Evaluator class implementations for Analog Function ICK
// Constructor
ICKEvaluator::ICKEvaluator(double U, double RCI0, double VLIM, double InvVPT, double VCES)
{
  ICKReturn_ = evaluator_(U, RCI0, VLIM, InvVPT, VCES);
}
// method to get precomputed values into double vars 
double ICKEvaluator::getValues(double  U, double  RCI0, double  VLIM, double  InvVPT, double  VCES)
{
  // Silence unused argument warnings
  (void) U;
  (void) RCI0;
  (void) VLIM;
  (void) InvVPT;
  (void) VCES;
  // Copy all precomputed values into corresponding output
  return(ICKReturn_.value);
}
// method to get total deriv w.r.t some variable via chain rule 
// given precomputed derivs of function w.r.t. args and derivs of args
// w.r.t desired vars
double ICKEvaluator::getDerivs(double U , double RCI0 , double VLIM , double InvVPT , double VCES  , double d_U, double d_RCI0, double d_VLIM, double d_InvVPT, double d_VCES)
{
  // Function total deriv
  double d_ICK;
  // Silence unused argument warnings
  (void) U;
  (void) RCI0;
  (void) VLIM;
  (void) InvVPT;
  (void) VCES;
  d_ICK = ICKReturn_.deriv_WRT_U*d_U+ICKReturn_.deriv_WRT_RCI0*d_RCI0+ICKReturn_.deriv_WRT_VLIM*d_VLIM+ICKReturn_.deriv_WRT_InvVPT*d_InvVPT+ICKReturn_.deriv_WRT_VCES*d_VCES;
  return(d_ICK);
}
// method that actually performs our computations.
ICKEvaluator::returnType ICKEvaluator::evaluator_(double U, double RCI0, double VLIM, double InvVPT, double VCES)
{
  // Function value and derivs variables, and a returnType to store everything
  double ICK;
  ICKEvaluator::returnType ICKReturn;
  // Derivatives of return value w.r.t input vars
  double d_ICK_d_U;
  double d_ICK_d_RCI0;
  double d_ICK_d_VLIM;
  double d_ICK_d_InvVPT;
  double d_ICK_d_VCES;
  // declared local variables
  double VC;
  double d_VC_d_U;
  double d_VC_d_RCI0;
  double d_VC_d_VLIM;
  double d_VC_d_InvVPT;
  double d_VC_d_VCES;
  double x;
  double d_x_d_U;
  double d_x_d_RCI0;
  double d_x_d_VLIM;
  double d_x_d_InvVPT;
  double d_x_d_VCES;
  {
    d_VC_d_U=d_Vceff(U,VCES,1.0,0.0);
    d_VC_d_RCI0=0.0;
    d_VC_d_VLIM=0.0;
    d_VC_d_InvVPT=0.0;
    d_VC_d_VCES=d_Vceff(U,VCES,0.0,1.0);
    VC=Vceff(U,VCES);
    d_x_d_U=(d_VC_d_U*InvVPT);
    d_x_d_RCI0=(d_VC_d_RCI0*InvVPT);
    d_x_d_VLIM=((d_VC_d_VLIM-1.0)*InvVPT);
    d_x_d_InvVPT=((VC-VLIM)+InvVPT*d_VC_d_InvVPT);
    d_x_d_VCES=(d_VC_d_VCES*InvVPT);
    x=((VC-VLIM)*InvVPT);
    d_ICK_d_U=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_U+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_U)+(d_x_d_U*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_U/VLIM))+((d_VC_d_U/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_U/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_RCI0=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_RCI0+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_RCI0)+(d_x_d_RCI0*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_RCI0/VLIM))+((d_VC_d_RCI0/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+(((RCI0*d_VC_d_RCI0-VC)/RCI0/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_VLIM=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_VLIM+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_VLIM)+(d_x_d_VLIM*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*((VLIM*d_VC_d_VLIM-VC)/VLIM/VLIM))+(((VLIM*d_VC_d_VLIM-VC)/VLIM/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_VLIM/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_InvVPT=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_InvVPT+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_InvVPT)+(d_x_d_InvVPT*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_InvVPT/VLIM))+((d_VC_d_InvVPT/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_InvVPT/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    d_ICK_d_VCES=((((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*((d_x_d_VCES+(0.5/sqrt(((x*x)+0.001)))*((x*d_x_d_VCES)+(d_x_d_VCES*x)))/2.0))+((((VC/RCI0)*(-(0.5/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))*(((VC/VLIM)*(d_VC_d_VCES/VLIM))+((d_VC_d_VCES/VLIM)*(VC/VLIM)))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))+((d_VC_d_VCES/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM)))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0))));
    ICK=(((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0)));
  }
  // now save outputs and derivs into appropriate return vars
  ICKReturn.value=ICK;
  ICKReturn.deriv_WRT_U = d_ICK_d_U;
  ICKReturn.deriv_WRT_RCI0 = d_ICK_d_RCI0;
  ICKReturn.deriv_WRT_VLIM = d_ICK_d_VLIM;
  ICKReturn.deriv_WRT_InvVPT = d_ICK_d_InvVPT;
  ICKReturn.deriv_WRT_VCES = d_ICK_d_VCES;
  return(ICKReturn);
}

} // namepace AnalogFunctions
JacobianStamp Instance::jacStamp;
IdVector Instance::nodeMap;
PairMap Instance::pairToJacStampMap;


//This is necessary because the IntPair usage can trip undefined references
const int Instance::admsNodeID_c;
const int Instance::admsNodeID_b;
const int Instance::admsNodeID_e;
const int Instance::admsNodeID_t;
const int Instance::admsNodeID_ei;
const int Instance::admsNodeID_bi;
const int Instance::admsNodeID_bii;
const int Instance::admsNodeID_ci;
const int Instance::admsNodeID_ti;
const int Instance::admsNodeID_ex;
const int Instance::admsNodeID_exx;
const int Instance::admsNodeID_cx;
const int Instance::admsNodeID_GND;
// Additional IDs for branch equations
const int Instance::admsBRA_ID_b_bi;
const int Instance::admsBRA_ID_e_ei;
const int Instance::admsBRA_ID_c_ci;


void
Traits::loadInstanceParameters(ParametricData<ADMSHBT_X::Instance> &p)
{
  // Set up each parameter directly, using the up-cased variable name
  // as the tag.

  // This kludge is to force us always to have an instance parameter
  // that the device manager can set to the temperature, even if we have
  // no "TEMP".
  p.addPar("XYCEADMSINSTTEMP", 0.0, &ADMSHBT_X::Instance::admsInstTemp)
    .setExpressionAccess(NO_DOC)
    .setUnit(U_DEGK)
    .setCategory(CAT_TEMP)
    .setDescription("Internal-use parameter for setting device instance temperature");
  p.addPar("TEMP", static_cast<double>(25.0), &ADMSHBT_X::Instance::Temp)
    .setUnit(U_DEGC)
    .setDescription("Device operating temperature")
    .setAutoConvertTemperature(false)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&instSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("N", static_cast<int>(1), &ADMSHBT_X::Instance::N)
    .setUnit(U_NONE)
    .setDescription("Number of emitter fingers");
  p.addPar("L", static_cast<double>(30*1.0e-6), &ADMSHBT_X::Instance::L)
    .setUnit(U_METER)
    .setDescription("Length of emitter fingers")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&instSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("W", static_cast<double>(3*1.0e-6), &ADMSHBT_X::Instance::W)
    .setUnit(U_METER)
    .setDescription("Width of emitter fingers")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&instSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;


}

void Traits::loadModelParameters(ParametricData<ADMSHBT_X::Model> &p)
{
  // Set up each parameter directly, using the up-cased variable name
  // as the tag.

  // This kludge is to force us always to have a model parameter
  // that the device manager can set to the temperature, even if we have
  // no "TEMP".
  p.addPar("XYCEADMSMODTEMP", 0.0, &ADMSHBT_X::Model::admsModTemp)
    .setExpressionAccess(NO_DOC)
    .setUnit(U_DEGK)
    .setCategory(CAT_TEMP)
    .setDescription("Internal-use parameter for setting device model temperature");
  p.addPar("MODE", static_cast<int>(1), &ADMSHBT_X::Model::Mode);
  p.addPar("NOISE", static_cast<int>(1), &ADMSHBT_X::Model::Noise);
  p.addPar("DEBUG", static_cast<int>(0), &ADMSHBT_X::Model::Debug);
  p.addPar("DEBUGPLUS", static_cast<int>(0), &ADMSHBT_X::Model::DebugPlus);
  p.addPar("TEMP", static_cast<double>(25.0), &ADMSHBT_X::Model::Temp)
    .setUnit(U_DEGC)
    .setDescription("Device operating temperature")
    .setAutoConvertTemperature(false)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RTH", static_cast<double>(0.1), &ADMSHBT_X::Model::Rth)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CTH", static_cast<double>(700*1.0e-9), &ADMSHBT_X::Model::Cth)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("N", static_cast<int>(1), &ADMSHBT_X::Model::N)
    .setUnit(U_NONE)
    .setDescription("Number of emitter fingers");
  p.addPar("L", static_cast<double>(30*1.0e-6), &ADMSHBT_X::Model::L)
    .setUnit(U_METER)
    .setDescription("Length of emitter fingers")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("W", static_cast<double>(3*1.0e-6), &ADMSHBT_X::Model::W)
    .setUnit(U_METER)
    .setDescription("Width of emitter fingers")
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JSF", static_cast<double>(20e-24), &ADMSHBT_X::Model::Jsf)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("NF", static_cast<double>(1.0), &ADMSHBT_X::Model::nf)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VG", static_cast<double>(1.3), &ADMSHBT_X::Model::Vg)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JSE", static_cast<double>(0.0), &ADMSHBT_X::Model::Jse)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("NE", static_cast<double>(0.0), &ADMSHBT_X::Model::ne)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RBXX", static_cast<double>(1e6), &ADMSHBT_X::Model::Rbxx)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VGB", static_cast<double>(0.0), &ADMSHBT_X::Model::Vgb)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JSEE", static_cast<double>(0.0), &ADMSHBT_X::Model::Jsee)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("NEE", static_cast<double>(0.0), &ADMSHBT_X::Model::nee)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RBBXX", static_cast<double>(1e6), &ADMSHBT_X::Model::Rbbxx)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VGBB", static_cast<double>(0.0), &ADMSHBT_X::Model::Vgbb)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JSR", static_cast<double>(20e-18), &ADMSHBT_X::Model::Jsr)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("NR", static_cast<double>(1.0), &ADMSHBT_X::Model::nr)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VGR", static_cast<double>(0.0), &ADMSHBT_X::Model::Vgr)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("XCJC", static_cast<double>(0.5), &ADMSHBT_X::Model::XCjc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JSC", static_cast<double>(0.0), &ADMSHBT_X::Model::Jsc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("NC", static_cast<double>(0.0), &ADMSHBT_X::Model::nc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RCXX", static_cast<double>(1e6), &ADMSHBT_X::Model::Rcxx)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VGC", static_cast<double>(0.0), &ADMSHBT_X::Model::Vgc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("BF", static_cast<double>(100.0), &ADMSHBT_X::Model::Bf)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("KBETA", static_cast<double>(0.0), &ADMSHBT_X::Model::kBeta)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("BR", static_cast<double>(1.0), &ADMSHBT_X::Model::Br)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VAF", static_cast<double>(0.0), &ADMSHBT_X::Model::VAF)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VAR", static_cast<double>(0.0), &ADMSHBT_X::Model::VAR)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("IKF", static_cast<double>(0.0), &ADMSHBT_X::Model::IKF)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("IKR", static_cast<double>(0.0), &ADMSHBT_X::Model::IKR)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("MC", static_cast<double>(0.0), &ADMSHBT_X::Model::Mc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("BVCEO", static_cast<double>(0.0), &ADMSHBT_X::Model::BVceo)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("KC", static_cast<double>(0.0), &ADMSHBT_X::Model::kc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("BVEBO", static_cast<double>(0.0), &ADMSHBT_X::Model::BVebo)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("TR", static_cast<double>(1*1.0e-15), &ADMSHBT_X::Model::Tr)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("TRX", static_cast<double>(1*1.0e-15), &ADMSHBT_X::Model::Trx)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("TF", static_cast<double>(1*1.0e-12), &ADMSHBT_X::Model::Tf)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("TFT", static_cast<double>(0.0), &ADMSHBT_X::Model::Tft)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("THCS", static_cast<double>(0.0), &ADMSHBT_X::Model::Thcs)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("AHC", static_cast<double>(0.0), &ADMSHBT_X::Model::Ahc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CJE", static_cast<double>(1*1.0e-15), &ADMSHBT_X::Model::Cje)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("MJE", static_cast<double>(0.5), &ADMSHBT_X::Model::mje)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VJE", static_cast<double>(1.3), &ADMSHBT_X::Model::Vje)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CJC", static_cast<double>(1*1.0e-15), &ADMSHBT_X::Model::Cjc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("MJC", static_cast<double>(0.5), &ADMSHBT_X::Model::mjc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VJC", static_cast<double>(1.3), &ADMSHBT_X::Model::Vjc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("KJC", static_cast<double>(1.0), &ADMSHBT_X::Model::kjc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CMIN", static_cast<double>(0.1*1.0e-15), &ADMSHBT_X::Model::Cmin)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("J0", static_cast<double>(1e-3), &ADMSHBT_X::Model::J0)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("XJ0", static_cast<double>(1.0), &ADMSHBT_X::Model::XJ0)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RCI0", static_cast<double>(1e-3), &ADMSHBT_X::Model::Rci0)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("JK", static_cast<double>(4e-4), &ADMSHBT_X::Model::Jk)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RJK", static_cast<double>(1e-3), &ADMSHBT_X::Model::RJk)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("VCES", static_cast<double>(1e-3), &ADMSHBT_X::Model::Vces)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RC", static_cast<double>(1.0), &ADMSHBT_X::Model::Rc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RE", static_cast<double>(1.0), &ADMSHBT_X::Model::Re)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RB", static_cast<double>(1.0), &ADMSHBT_X::Model::Rb)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("RB2", static_cast<double>(1.0), &ADMSHBT_X::Model::Rb2)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("LC", static_cast<double>(0.0), &ADMSHBT_X::Model::Lc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("LE", static_cast<double>(0.0), &ADMSHBT_X::Model::Le)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("LB", static_cast<double>(0.0), &ADMSHBT_X::Model::Lb)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CQ", static_cast<double>(0.0), &ADMSHBT_X::Model::Cq)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CPB", static_cast<double>(0.0), &ADMSHBT_X::Model::Cpb)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("CPC", static_cast<double>(0.0), &ADMSHBT_X::Model::Cpc)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  p.addPar("TNOM", static_cast<double>(20.0), &ADMSHBT_X::Model::Tnom)
    .setAutoConvertTemperature(false)
#ifdef Xyce_ADMS_SENSITIVITIES
    .setAnalyticSensitivityAvailable(true)
    .setSensitivityFunctor(&modSens)
#endif // Xyce_ADMS_SENSITIVITIES
    ;
  //Hidden parameter dtype

}

//-----------------------------------------------------------------------------
// Function      : Instance::processParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::processParams()
{
  // set any non-constant parameter defaults

  // copy any model variables that have associated instance variables, but
  // are only given in the model card:
  if (!(given("Temp")))
  {
    Temp = model_.Temp;
  }
  if (!(given("N")))
  {
    N = model_.N;
  }
  if (!(given("L")))
  {
    L = model_.L;
  }
  if (!(given("W")))
  {
    W = model_.W;
  }



  // Set any parameters that were not given and whose defaults depend on other
  // parameters:


  // Now we need to check that any parameters are within their ranges as
  // specified in the verilog:

  //    Parameter Temp : [ (-273.15),  (+inf) [
  if ( (!((Temp >=(-273.15)))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Temp value " << Temp << " out of range [ (-273.15),  (+inf) [";
  }

  //    Parameter N : ] 0,  (+inf) [
  if ( (!((N >0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter N value " << N << " out of range ] 0,  (+inf) [";
  }

  //    Parameter L : ] 0.0,  (+inf) [
  if ( (!((L >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter L value " << L << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter W : ] 0.0,  (+inf) [
  if ( (!((W >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter W value " << W << " out of range ] 0.0,  (+inf) [";
  }


  // this seems a little stupid, but verilog models that use $temperature
  // don't also use a defined parameter "Temp", and count on $temperature
  // to be the one the simulator wants:

  updateTemperature(admsInstTemp);

  // and of course, this routine is where we should put the initial_instance
  // stuff


  return true;
}

//-----------------------------------------------------------------------------
// Function      : Instance::Instance
// Purpose       : "instance block" constructor
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------

Instance::Instance(
   const Configuration & configuration,
   const InstanceBlock & instance_block,
   Model &               model,
   const FactoryBlock &  factory_block)
  : DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
    model_(model),
    Temp(25.0),
    N(1),
    L(30*1.0e-6),
    W(3*1.0e-6),
    li_c(-1),
    li_b(-1),
    li_e(-1),
    li_t(-1),
    li_ei(-1),
    li_bi(-1),
    li_bii(-1),
    li_ci(-1),
    li_ti(-1),
    li_ex(-1),
    li_exx(-1),
    li_cx(-1),
    li_BRA_b_bi(-1),
    li_BRA_e_ei(-1),
    li_BRA_c_ci(-1),
    li_branch_ic(-1),
    li_branch_ib(-1),
    li_branch_ie(-1),
    li_branch_it(-1),
    f_bi_Equ_ti_Node_Ptr(0),
    f_ci_Equ_ti_Node_Ptr(0),
    f_bi_Equ_bi_Node_Ptr(0),
    f_bi_Equ_ci_Node_Ptr(0),
    f_ci_Equ_bi_Node_Ptr(0),
    f_ci_Equ_ci_Node_Ptr(0),
    f_bii_Equ_ti_Node_Ptr(0),
    f_bii_Equ_bii_Node_Ptr(0),
    f_bii_Equ_ci_Node_Ptr(0),
    f_ci_Equ_bii_Node_Ptr(0),
    f_bii_Equ_ei_Node_Ptr(0),
    f_ci_Equ_ei_Node_Ptr(0),
    f_ei_Equ_bii_Node_Ptr(0),
    f_ei_Equ_ci_Node_Ptr(0),
    f_ei_Equ_ti_Node_Ptr(0),
    f_ei_Equ_ei_Node_Ptr(0),
    f_ex_Equ_ti_Node_Ptr(0),
    f_ex_Equ_ex_Node_Ptr(0),
    f_ex_Equ_ei_Node_Ptr(0),
    f_ei_Equ_ex_Node_Ptr(0),
    f_exx_Equ_ti_Node_Ptr(0),
    f_exx_Equ_exx_Node_Ptr(0),
    f_exx_Equ_ei_Node_Ptr(0),
    f_ei_Equ_exx_Node_Ptr(0),
    f_cx_Equ_ti_Node_Ptr(0),
    f_cx_Equ_cx_Node_Ptr(0),
    f_cx_Equ_ci_Node_Ptr(0),
    f_ci_Equ_cx_Node_Ptr(0),
    f_bii_Equ_bi_Node_Ptr(0),
    f_bi_Equ_bii_Node_Ptr(0),
    f_ex_Equ_bii_Node_Ptr(0),
    f_bii_Equ_ex_Node_Ptr(0),
    f_exx_Equ_bii_Node_Ptr(0),
    f_bii_Equ_exx_Node_Ptr(0),
    f_cx_Equ_bii_Node_Ptr(0),
    f_bii_Equ_cx_Node_Ptr(0),
    f_b_Equ_b_Node_Ptr(0),
    f_c_Equ_c_Node_Ptr(0),
    f_b_Equ_c_Node_Ptr(0),
    f_c_Equ_b_Node_Ptr(0),
    f_ti_Equ_bi_Node_Ptr(0),
    f_ti_Equ_ci_Node_Ptr(0),
    f_ti_Equ_ei_Node_Ptr(0),
    f_ti_Equ_bii_Node_Ptr(0),
    f_ti_Equ_ti_Node_Ptr(0),
    f_t_Equ_t_Node_Ptr(0),
    f_t_Equ_ti_Node_Ptr(0),
    f_ti_Equ_t_Node_Ptr(0),
    f_c_Equ_BRA_c_ci_Var_Ptr(0),
    f_b_Equ_BRA_b_bi_Var_Ptr(0),
    f_e_Equ_BRA_e_ei_Var_Ptr(0),
    f_ei_Equ_BRA_e_ei_Var_Ptr(0),
    f_bi_Equ_BRA_b_bi_Var_Ptr(0),
    f_ci_Equ_BRA_c_ci_Var_Ptr(0),
    f_BRA_b_bi_Equ_b_Node_Ptr(0),
    f_BRA_b_bi_Equ_bi_Node_Ptr(0),
    f_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr(0),
    f_BRA_e_ei_Equ_e_Node_Ptr(0),
    f_BRA_e_ei_Equ_ei_Node_Ptr(0),
    f_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr(0),
    f_BRA_c_ci_Equ_c_Node_Ptr(0),
    f_BRA_c_ci_Equ_ci_Node_Ptr(0),
    f_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr(0),
    q_bi_Equ_ti_Node_Ptr(0),
    q_ci_Equ_ti_Node_Ptr(0),
    q_bi_Equ_bi_Node_Ptr(0),
    q_bi_Equ_ci_Node_Ptr(0),
    q_ci_Equ_bi_Node_Ptr(0),
    q_ci_Equ_ci_Node_Ptr(0),
    q_bii_Equ_ti_Node_Ptr(0),
    q_bii_Equ_bii_Node_Ptr(0),
    q_bii_Equ_ci_Node_Ptr(0),
    q_ci_Equ_bii_Node_Ptr(0),
    q_bii_Equ_ei_Node_Ptr(0),
    q_ci_Equ_ei_Node_Ptr(0),
    q_ei_Equ_bii_Node_Ptr(0),
    q_ei_Equ_ci_Node_Ptr(0),
    q_ei_Equ_ti_Node_Ptr(0),
    q_ei_Equ_ei_Node_Ptr(0),
    q_ex_Equ_ti_Node_Ptr(0),
    q_ex_Equ_ex_Node_Ptr(0),
    q_ex_Equ_ei_Node_Ptr(0),
    q_ei_Equ_ex_Node_Ptr(0),
    q_exx_Equ_ti_Node_Ptr(0),
    q_exx_Equ_exx_Node_Ptr(0),
    q_exx_Equ_ei_Node_Ptr(0),
    q_ei_Equ_exx_Node_Ptr(0),
    q_cx_Equ_ti_Node_Ptr(0),
    q_cx_Equ_cx_Node_Ptr(0),
    q_cx_Equ_ci_Node_Ptr(0),
    q_ci_Equ_cx_Node_Ptr(0),
    q_bii_Equ_bi_Node_Ptr(0),
    q_bi_Equ_bii_Node_Ptr(0),
    q_ex_Equ_bii_Node_Ptr(0),
    q_bii_Equ_ex_Node_Ptr(0),
    q_exx_Equ_bii_Node_Ptr(0),
    q_bii_Equ_exx_Node_Ptr(0),
    q_cx_Equ_bii_Node_Ptr(0),
    q_bii_Equ_cx_Node_Ptr(0),
    q_b_Equ_b_Node_Ptr(0),
    q_c_Equ_c_Node_Ptr(0),
    q_b_Equ_c_Node_Ptr(0),
    q_c_Equ_b_Node_Ptr(0),
    q_ti_Equ_bi_Node_Ptr(0),
    q_ti_Equ_ci_Node_Ptr(0),
    q_ti_Equ_ei_Node_Ptr(0),
    q_ti_Equ_bii_Node_Ptr(0),
    q_ti_Equ_ti_Node_Ptr(0),
    q_t_Equ_t_Node_Ptr(0),
    q_t_Equ_ti_Node_Ptr(0),
    q_ti_Equ_t_Node_Ptr(0),
    q_c_Equ_BRA_c_ci_Var_Ptr(0),
    q_b_Equ_BRA_b_bi_Var_Ptr(0),
    q_e_Equ_BRA_e_ei_Var_Ptr(0),
    q_ei_Equ_BRA_e_ei_Var_Ptr(0),
    q_bi_Equ_BRA_b_bi_Var_Ptr(0),
    q_ci_Equ_BRA_c_ci_Var_Ptr(0),
    q_BRA_b_bi_Equ_b_Node_Ptr(0),
    q_BRA_b_bi_Equ_bi_Node_Ptr(0),
    q_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr(0),
    q_BRA_e_ei_Equ_e_Node_Ptr(0),
    q_BRA_e_ei_Equ_ei_Node_Ptr(0),
    q_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr(0),
    q_BRA_c_ci_Equ_c_Node_Ptr(0),
    q_BRA_c_ci_Equ_ci_Node_Ptr(0),
    q_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr(0),
    A_bi_Equ_ti_NodeOffset(-1),
    A_ci_Equ_ti_NodeOffset(-1),
    A_bi_Equ_bi_NodeOffset(-1),
    A_bi_Equ_ci_NodeOffset(-1),
    A_ci_Equ_bi_NodeOffset(-1),
    A_ci_Equ_ci_NodeOffset(-1),
    A_bii_Equ_ti_NodeOffset(-1),
    A_bii_Equ_bii_NodeOffset(-1),
    A_bii_Equ_ci_NodeOffset(-1),
    A_ci_Equ_bii_NodeOffset(-1),
    A_bii_Equ_ei_NodeOffset(-1),
    A_ci_Equ_ei_NodeOffset(-1),
    A_ei_Equ_bii_NodeOffset(-1),
    A_ei_Equ_ci_NodeOffset(-1),
    A_ei_Equ_ti_NodeOffset(-1),
    A_ei_Equ_ei_NodeOffset(-1),
    A_ex_Equ_ti_NodeOffset(-1),
    A_ex_Equ_ex_NodeOffset(-1),
    A_ex_Equ_ei_NodeOffset(-1),
    A_ei_Equ_ex_NodeOffset(-1),
    A_exx_Equ_ti_NodeOffset(-1),
    A_exx_Equ_exx_NodeOffset(-1),
    A_exx_Equ_ei_NodeOffset(-1),
    A_ei_Equ_exx_NodeOffset(-1),
    A_cx_Equ_ti_NodeOffset(-1),
    A_cx_Equ_cx_NodeOffset(-1),
    A_cx_Equ_ci_NodeOffset(-1),
    A_ci_Equ_cx_NodeOffset(-1),
    A_bii_Equ_bi_NodeOffset(-1),
    A_bi_Equ_bii_NodeOffset(-1),
    A_ex_Equ_bii_NodeOffset(-1),
    A_bii_Equ_ex_NodeOffset(-1),
    A_exx_Equ_bii_NodeOffset(-1),
    A_bii_Equ_exx_NodeOffset(-1),
    A_cx_Equ_bii_NodeOffset(-1),
    A_bii_Equ_cx_NodeOffset(-1),
    A_b_Equ_b_NodeOffset(-1),
    A_c_Equ_c_NodeOffset(-1),
    A_b_Equ_c_NodeOffset(-1),
    A_c_Equ_b_NodeOffset(-1),
    A_ti_Equ_bi_NodeOffset(-1),
    A_ti_Equ_ci_NodeOffset(-1),
    A_ti_Equ_ei_NodeOffset(-1),
    A_ti_Equ_bii_NodeOffset(-1),
    A_ti_Equ_ti_NodeOffset(-1),
    A_t_Equ_t_NodeOffset(-1),
    A_t_Equ_ti_NodeOffset(-1),
    A_ti_Equ_t_NodeOffset(-1),
    A_c_Equ_BRA_c_ci_Var_Offset(-1),
    A_b_Equ_BRA_b_bi_Var_Offset(-1),
    A_e_Equ_BRA_e_ei_Var_Offset(-1),
    A_ei_Equ_BRA_e_ei_Var_Offset(-1),
    A_bi_Equ_BRA_b_bi_Var_Offset(-1),
    A_ci_Equ_BRA_c_ci_Var_Offset(-1),
    A_BRA_b_bi_Equ_b_Node_Offset(-1),
    A_BRA_b_bi_Equ_bi_Node_Offset(-1),
    A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset(-1),
    A_BRA_e_ei_Equ_e_Node_Offset(-1),
    A_BRA_e_ei_Equ_ei_Node_Offset(-1),
    A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset(-1),
    A_BRA_c_ci_Equ_c_Node_Offset(-1),
    A_BRA_c_ci_Equ_ci_Node_Offset(-1),
    A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset(-1),
    li_store_admsProbeID_V_bi_ci(-1),
    li_store_admsProbeID_V_bii_ci(-1),
    li_store_admsProbeID_V_bii_ei(-1),
    admsTemperature(getDeviceOptions().temp.getImmutableValue<double>())

{
  numIntVars = 8 + 3;
  numExtVars = 4;

  // Right now, we only have store for limited probes and output vars...
  setNumStoreVars(3+0);

  // Do not allocate "branch" (lead current) vectors by default
  setNumBranchDataVars(0);
  numBranchDataVarsIfAllocated = 4;

  leadCurrentF.resize(4);
  leadCurrentQ.resize(4);

  // Set up jacobian stamp:
  // Create a vector of the non-zero elements of the stamp
  PairVector jacobianElements;
  jacobianElements.push_back(IntPair(admsNodeID_c,admsNodeID_c));
  jacobianElements.push_back(IntPair(admsNodeID_c,admsNodeID_b));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_c,admsBRA_ID_c_ci));
  jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_b));
  jacobianElements.push_back(IntPair(admsNodeID_b,admsNodeID_c));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_b,admsBRA_ID_b_bi));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_e,admsBRA_ID_e_ei));
  jacobianElements.push_back(IntPair(admsNodeID_t,admsNodeID_t));
  jacobianElements.push_back(IntPair(admsNodeID_t,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_ex));
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsNodeID_exx));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_ei,admsBRA_ID_e_ei));
  jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_bi));
  jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_bi,admsNodeID_bii));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_bi,admsBRA_ID_b_bi));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_bi));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_ex));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_exx));
  jacobianElements.push_back(IntPair(admsNodeID_bii,admsNodeID_cx));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_bi));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsNodeID_cx));
  // Extra columns for dependence on branches
  jacobianElements.push_back(IntPair(admsNodeID_ci,admsBRA_ID_c_ci));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_bi));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_ti,admsNodeID_t));
  jacobianElements.push_back(IntPair(admsNodeID_ex,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_ex,admsNodeID_ex));
  jacobianElements.push_back(IntPair(admsNodeID_ex,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_ex,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_exx,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_exx,admsNodeID_exx));
  jacobianElements.push_back(IntPair(admsNodeID_exx,admsNodeID_ei));
  jacobianElements.push_back(IntPair(admsNodeID_exx,admsNodeID_bii));
  jacobianElements.push_back(IntPair(admsNodeID_cx,admsNodeID_ti));
  jacobianElements.push_back(IntPair(admsNodeID_cx,admsNodeID_cx));
  jacobianElements.push_back(IntPair(admsNodeID_cx,admsNodeID_ci));
  jacobianElements.push_back(IntPair(admsNodeID_cx,admsNodeID_bii));
  // Jacobian rows for branch equations
  jacobianElements.push_back(IntPair(admsBRA_ID_b_bi,admsNodeID_b));   // Branch eqn b,bi - node b
  jacobianElements.push_back(IntPair(admsBRA_ID_b_bi,admsNodeID_bi));   // Branch eqn b,bi - node bi
  jacobianElements.push_back(IntPair(admsBRA_ID_b_bi,admsBRA_ID_b_bi)); // Branch eqn b,bi - branch var b,bi
  jacobianElements.push_back(IntPair(admsBRA_ID_e_ei,admsNodeID_e));   // Branch eqn e,ei - node e
  jacobianElements.push_back(IntPair(admsBRA_ID_e_ei,admsNodeID_ei));   // Branch eqn e,ei - node ei
  jacobianElements.push_back(IntPair(admsBRA_ID_e_ei,admsBRA_ID_e_ei)); // Branch eqn e,ei - branch var e,ei
  jacobianElements.push_back(IntPair(admsBRA_ID_c_ci,admsNodeID_c));   // Branch eqn c,ci - node c
  jacobianElements.push_back(IntPair(admsBRA_ID_c_ci,admsNodeID_ci));   // Branch eqn c,ci - node ci
  jacobianElements.push_back(IntPair(admsBRA_ID_c_ci,admsBRA_ID_c_ci)); // Branch eqn c,ci - branch var c,ci



  setDefaultParams();
  setParams(instance_block.params);

  // Real bogosity here...
  if (!given("XYCEADMSINSTTEMP"))
    admsInstTemp=getDeviceOptions().temp.getImmutableValue<double>();

  //calculate any parameters specified as expressions
  updateDependentParameters();

  // calculate dependent (i.e. computed params) and check for errors.
  processParams();

  PairVector collapsedNodes;

  // Now generate the jacstamp from what we already have.
  // This jacstamp will have all the correct node mapping.  map will be the nodal mapping of original
  // node IDs to row/column ids in the reduced (non-sparse) representation of the jacobian.
  // (for devices that have no collapsibles, this will be static, so check that it hasn't already
  // been filled in)
  if (jacStamp.empty())
  {
    int originalSize = 12+3;
    computeJacStampAndMaps(jacobianElements,collapsedNodes,jacStamp,nodeMap,pairToJacStampMap,originalSize);
  }

}

//-----------------------------------------------------------------------------
// Function      : Instance::~Instance
// Purpose       : destructor
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
Instance::~Instance()
{
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerLIDs
// Purpose       : function for registering, and setting up, local IDs.
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerLIDs( const LocalIdVector & intLIDVecRef,
                             const LocalIdVector & extLIDVecRef)
{
  AssertLIDs(intLIDVecRef.size() == numIntVars);
  AssertLIDs(extLIDVecRef.size() == numExtVars);

  LocalIdVector localLIDVec;

  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
  {
    Xyce::dout() << std::endl << section_divider << std::endl
                 << "In ADMSHBT_X::Instance::register LIDs\n\n"
                 << "name             = " << getName() << std::endl
                 << "number of internal variables: " << numIntVars << std::endl
                 << "number of external variables: " << numExtVars << std::endl;
  }

  // copy over the global ID lists into a local array.
  // The end result of this is an array of LIDs corresponding to all the
  // nodes we actually have, in the order that topology thinks of them
  intLIDVec = intLIDVecRef;
  extLIDVec = extLIDVecRef;
  localLIDVec.resize(numExtVars+numIntVars);
  for (int localNodeIndex=0;localNodeIndex<numExtVars;++localNodeIndex)
  {
    localLIDVec[localNodeIndex]=extLIDVec[localNodeIndex];
  }
  for (int localNodeIndex=numExtVars;localNodeIndex<numExtVars+numIntVars;++localNodeIndex)
  {
    localLIDVec[localNodeIndex]=intLIDVec[localNodeIndex-numExtVars];
  }

  // Now pull the LIDs for each of our nodes out of the local array.
  // Use the node mapping created by createJacStampAndMaps to handle
  // all the node collapse complications.
  li_c = localLIDVec[nodeMap[admsNodeID_c]];
  li_b = localLIDVec[nodeMap[admsNodeID_b]];
  li_e = localLIDVec[nodeMap[admsNodeID_e]];
  li_t = localLIDVec[nodeMap[admsNodeID_t]];
  li_ei = localLIDVec[nodeMap[admsNodeID_ei]];
  li_bi = localLIDVec[nodeMap[admsNodeID_bi]];
  li_bii = localLIDVec[nodeMap[admsNodeID_bii]];
  li_ci = localLIDVec[nodeMap[admsNodeID_ci]];
  li_ti = localLIDVec[nodeMap[admsNodeID_ti]];
  li_ex = localLIDVec[nodeMap[admsNodeID_ex]];
  li_exx = localLIDVec[nodeMap[admsNodeID_exx]];
  li_cx = localLIDVec[nodeMap[admsNodeID_cx]];
  li_BRA_b_bi = localLIDVec[nodeMap[admsBRA_ID_b_bi]];
  li_BRA_e_ei = localLIDVec[nodeMap[admsBRA_ID_e_ei]];
  li_BRA_c_ci = localLIDVec[nodeMap[admsBRA_ID_c_ci]];


  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
  {
    Xyce::dout() << "\nSolution and RHS variables:\n";
    Xyce::dout() << "\nli_c = " << li_c << std::endl;
    Xyce::dout() << "\nli_b = " << li_b << std::endl;
    Xyce::dout() << "\nli_e = " << li_e << std::endl;
    Xyce::dout() << "\nli_t = " << li_t << std::endl;
    Xyce::dout() << "\nli_ei = " << li_ei << std::endl;
    Xyce::dout() << "\nli_bi = " << li_bi << std::endl;
    Xyce::dout() << "\nli_bii = " << li_bii << std::endl;
    Xyce::dout() << "\nli_ci = " << li_ci << std::endl;
    Xyce::dout() << "\nli_ti = " << li_ti << std::endl;
    Xyce::dout() << "\nli_ex = " << li_ex << std::endl;
    Xyce::dout() << "\nli_exx = " << li_exx << std::endl;
    Xyce::dout() << "\nli_cx = " << li_cx << std::endl;
    Xyce::dout() << "\nli_BRA_b_bi = " << li_BRA_b_bi << std::endl;
    Xyce::dout() << "\nli_BRA_e_ei = " << li_BRA_e_ei << std::endl;
    Xyce::dout() << "\nli_BRA_c_ci = " << li_BRA_c_ci << std::endl;

    Xyce::dout() << "\nEnd of ADMSHBT_X::Instance::register LIDs\n";
    Xyce::dout() << section_divider << std::endl;
  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::loadNodeSymbols
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::loadNodeSymbols(Util::SymbolTable &symbol_table) const
{
  addInternalNode(symbol_table, li_ei, getName(), "ei");
  addInternalNode(symbol_table, li_bi, getName(), "bi");
  addInternalNode(symbol_table, li_bii, getName(), "bii");
  addInternalNode(symbol_table, li_ci, getName(), "ci");
  addInternalNode(symbol_table, li_ti, getName(), "ti");
  addInternalNode(symbol_table, li_ex, getName(), "ex");
  addInternalNode(symbol_table, li_exx, getName(), "exx");
  addInternalNode(symbol_table, li_cx, getName(), "cx");
  addInternalNode(symbol_table, li_BRA_b_bi, getName(), "b_bi_branch");
  addInternalNode(symbol_table, li_BRA_e_ei, getName(), "e_ei_branch");
  addInternalNode(symbol_table, li_BRA_c_ci, getName(), "c_ci_branch");

  if (loadLeadCurrent)
  {
    addBranchDataNode( symbol_table, li_branch_ic, getName(), "BRANCH_DC");
    addBranchDataNode( symbol_table, li_branch_ib, getName(), "BRANCH_DB");
    addBranchDataNode( symbol_table, li_branch_ie, getName(), "BRANCH_DE");
    addBranchDataNode( symbol_table, li_branch_it, getName(), "BRANCH_D4");


  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerStoreLIDs
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerStoreLIDs( const LocalIdVector & stoLIDVecRef)
{
  AssertLIDs(stoLIDVecRef.size() == getNumStoreVars());

  int numSto = stoLIDVecRef.size();
  if (numSto > 0)
  {
    int i=0;
    stoLIDVec = stoLIDVecRef;

    li_store_admsProbeID_V_bi_ci = stoLIDVec[i++];
    li_store_admsProbeID_V_bii_ci = stoLIDVec[i++];
    li_store_admsProbeID_V_bii_ei = stoLIDVec[i++];
  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerBranchDataLIDs
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : Eric Keiter, SNL
// Creation Date : 12/09/11
//-----------------------------------------------------------------------------
void Instance::registerBranchDataLIDs(const std::vector<int> & branchLIDVecRef)
{
  AssertLIDs(branchLIDVecRef.size() == getNumBranchDataVars());

  if (loadLeadCurrent)
  {
    int i = 0;
    li_branch_ic = branchLIDVecRef[i++];
    li_branch_ib = branchLIDVecRef[i++];
    li_branch_ie = branchLIDVecRef[i++];
    li_branch_it = branchLIDVecRef[i++];

  }
}

//-----------------------------------------------------------------------------
// Function      : Instance::jacobianStamp
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
const JacobianStamp & Instance::jacobianStamp() const
{
  return jacStamp;
}

//-----------------------------------------------------------------------------
// Function      : Instance::registerJacLIDs
// Purpose       : Create Offset variables used for referencing jacobian
//                 elements
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::registerJacLIDs( const JacobianStamp & jacLIDVec)
{
  DeviceInstance::registerJacLIDs(jacLIDVec);  IntPair jacLoc;
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_c,admsNodeID_c)];
  A_c_Equ_c_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_c,admsNodeID_b)];
  A_c_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_c,admsBRA_ID_c_ci)];
  A_c_Equ_BRA_c_ci_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_b)];
  A_b_Equ_b_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_b,admsNodeID_c)];
  A_b_Equ_c_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_b,admsBRA_ID_b_bi)];
  A_b_Equ_BRA_b_bi_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_e,admsBRA_ID_e_ei)];
  A_e_Equ_BRA_e_ei_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_t,admsNodeID_t)];
  A_t_Equ_t_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_t,admsNodeID_ti)];
  A_t_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_bii)];
  A_ei_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ci)];
  A_ei_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ti)];
  A_ei_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ei)];
  A_ei_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_ex)];
  A_ei_Equ_ex_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ei,admsNodeID_exx)];
  A_ei_Equ_exx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_ei,admsBRA_ID_e_ei)];
  A_ei_Equ_BRA_e_ei_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_ti)];
  A_bi_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_bi)];
  A_bi_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_ci)];
  A_bi_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bi,admsNodeID_bii)];
  A_bi_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_bi,admsBRA_ID_b_bi)];
  A_bi_Equ_BRA_b_bi_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_ti)];
  A_bii_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_bii)];
  A_bii_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_ci)];
  A_bii_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_ei)];
  A_bii_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_bi)];
  A_bii_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_ex)];
  A_bii_Equ_ex_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_exx)];
  A_bii_Equ_exx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_bii,admsNodeID_cx)];
  A_bii_Equ_cx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_ti)];
  A_ci_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_bi)];
  A_ci_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_ci)];
  A_ci_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_bii)];
  A_ci_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_ei)];
  A_ci_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ci,admsNodeID_cx)];
  A_ci_Equ_cx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc=pairToJacStampMap[IntPair(admsNodeID_ci,admsBRA_ID_c_ci)];
  A_ci_Equ_BRA_c_ci_Var_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_bi)];
  A_ti_Equ_bi_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_ci)];
  A_ti_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_ei)];
  A_ti_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_bii)];
  A_ti_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_ti)];
  A_ti_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ti,admsNodeID_t)];
  A_ti_Equ_t_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ex,admsNodeID_ti)];
  A_ex_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ex,admsNodeID_ex)];
  A_ex_Equ_ex_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ex,admsNodeID_ei)];
  A_ex_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_ex,admsNodeID_bii)];
  A_ex_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_exx,admsNodeID_ti)];
  A_exx_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_exx,admsNodeID_exx)];
  A_exx_Equ_exx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_exx,admsNodeID_ei)];
  A_exx_Equ_ei_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_exx,admsNodeID_bii)];
  A_exx_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_cx,admsNodeID_ti)];
  A_cx_Equ_ti_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_cx,admsNodeID_cx)];
  A_cx_Equ_cx_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_cx,admsNodeID_ci)];
  A_cx_Equ_ci_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsNodeID_cx,admsNodeID_bii)];
  A_cx_Equ_bii_NodeOffset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_b_bi,admsNodeID_b)];
  A_BRA_b_bi_Equ_b_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_b_bi,admsNodeID_bi)];
  A_BRA_b_bi_Equ_bi_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_b_bi,admsBRA_ID_b_bi)];
  A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset=jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_e_ei,admsNodeID_e)];
  A_BRA_e_ei_Equ_e_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_e_ei,admsNodeID_ei)];
  A_BRA_e_ei_Equ_ei_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_e_ei,admsBRA_ID_e_ei)];
  A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset=jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_c_ci,admsNodeID_c)];
  A_BRA_c_ci_Equ_c_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_c_ci,admsNodeID_ci)];
  A_BRA_c_ci_Equ_ci_Node_Offset = jacLIDVec[jacLoc.first][jacLoc.second];
  jacLoc = pairToJacStampMap[IntPair(admsBRA_ID_c_ci,admsBRA_ID_c_ci)];
  A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset=jacLIDVec[jacLoc.first][jacLoc.second];


}

//-----------------------------------------------------------------------------
// Function      : Instance::setupPointers
// Purpose       : Create pointer variables used for referencing jacobian
//                 elements
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void Instance::setupPointers( )
{

  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);
  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);
  f_c_Equ_c_Node_Ptr = &(dFdx[li_c][A_c_Equ_c_NodeOffset]);
  q_c_Equ_c_Node_Ptr = &(dQdx[li_c][A_c_Equ_c_NodeOffset]);
  f_c_Equ_b_Node_Ptr = &(dFdx[li_c][A_c_Equ_b_NodeOffset]);
  q_c_Equ_b_Node_Ptr = &(dQdx[li_c][A_c_Equ_b_NodeOffset]);
  f_c_Equ_BRA_c_ci_Var_Ptr = &(dFdx[li_c][A_c_Equ_BRA_c_ci_Var_Offset]);
  q_c_Equ_BRA_c_ci_Var_Ptr = &(dQdx[li_c][A_c_Equ_BRA_c_ci_Var_Offset]);
  f_b_Equ_b_Node_Ptr = &(dFdx[li_b][A_b_Equ_b_NodeOffset]);
  q_b_Equ_b_Node_Ptr = &(dQdx[li_b][A_b_Equ_b_NodeOffset]);
  f_b_Equ_c_Node_Ptr = &(dFdx[li_b][A_b_Equ_c_NodeOffset]);
  q_b_Equ_c_Node_Ptr = &(dQdx[li_b][A_b_Equ_c_NodeOffset]);
  f_b_Equ_BRA_b_bi_Var_Ptr = &(dFdx[li_b][A_b_Equ_BRA_b_bi_Var_Offset]);
  q_b_Equ_BRA_b_bi_Var_Ptr = &(dQdx[li_b][A_b_Equ_BRA_b_bi_Var_Offset]);
  f_e_Equ_BRA_e_ei_Var_Ptr = &(dFdx[li_e][A_e_Equ_BRA_e_ei_Var_Offset]);
  q_e_Equ_BRA_e_ei_Var_Ptr = &(dQdx[li_e][A_e_Equ_BRA_e_ei_Var_Offset]);
  f_t_Equ_t_Node_Ptr = &(dFdx[li_t][A_t_Equ_t_NodeOffset]);
  q_t_Equ_t_Node_Ptr = &(dQdx[li_t][A_t_Equ_t_NodeOffset]);
  f_t_Equ_ti_Node_Ptr = &(dFdx[li_t][A_t_Equ_ti_NodeOffset]);
  q_t_Equ_ti_Node_Ptr = &(dQdx[li_t][A_t_Equ_ti_NodeOffset]);
  f_ei_Equ_bii_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_bii_NodeOffset]);
  q_ei_Equ_bii_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_bii_NodeOffset]);
  f_ei_Equ_ci_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ci_NodeOffset]);
  q_ei_Equ_ci_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ci_NodeOffset]);
  f_ei_Equ_ti_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ti_NodeOffset]);
  q_ei_Equ_ti_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ti_NodeOffset]);
  f_ei_Equ_ei_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ei_NodeOffset]);
  q_ei_Equ_ei_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ei_NodeOffset]);
  f_ei_Equ_ex_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_ex_NodeOffset]);
  q_ei_Equ_ex_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_ex_NodeOffset]);
  f_ei_Equ_exx_Node_Ptr = &(dFdx[li_ei][A_ei_Equ_exx_NodeOffset]);
  q_ei_Equ_exx_Node_Ptr = &(dQdx[li_ei][A_ei_Equ_exx_NodeOffset]);
  f_ei_Equ_BRA_e_ei_Var_Ptr = &(dFdx[li_ei][A_ei_Equ_BRA_e_ei_Var_Offset]);
  q_ei_Equ_BRA_e_ei_Var_Ptr = &(dQdx[li_ei][A_ei_Equ_BRA_e_ei_Var_Offset]);
  f_bi_Equ_ti_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_ti_NodeOffset]);
  q_bi_Equ_ti_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_ti_NodeOffset]);
  f_bi_Equ_bi_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_bi_NodeOffset]);
  q_bi_Equ_bi_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_bi_NodeOffset]);
  f_bi_Equ_ci_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_ci_NodeOffset]);
  q_bi_Equ_ci_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_ci_NodeOffset]);
  f_bi_Equ_bii_Node_Ptr = &(dFdx[li_bi][A_bi_Equ_bii_NodeOffset]);
  q_bi_Equ_bii_Node_Ptr = &(dQdx[li_bi][A_bi_Equ_bii_NodeOffset]);
  f_bi_Equ_BRA_b_bi_Var_Ptr = &(dFdx[li_bi][A_bi_Equ_BRA_b_bi_Var_Offset]);
  q_bi_Equ_BRA_b_bi_Var_Ptr = &(dQdx[li_bi][A_bi_Equ_BRA_b_bi_Var_Offset]);
  f_bii_Equ_ti_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_ti_NodeOffset]);
  q_bii_Equ_ti_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_ti_NodeOffset]);
  f_bii_Equ_bii_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_bii_NodeOffset]);
  q_bii_Equ_bii_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_bii_NodeOffset]);
  f_bii_Equ_ci_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_ci_NodeOffset]);
  q_bii_Equ_ci_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_ci_NodeOffset]);
  f_bii_Equ_ei_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_ei_NodeOffset]);
  q_bii_Equ_ei_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_ei_NodeOffset]);
  f_bii_Equ_bi_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_bi_NodeOffset]);
  q_bii_Equ_bi_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_bi_NodeOffset]);
  f_bii_Equ_ex_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_ex_NodeOffset]);
  q_bii_Equ_ex_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_ex_NodeOffset]);
  f_bii_Equ_exx_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_exx_NodeOffset]);
  q_bii_Equ_exx_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_exx_NodeOffset]);
  f_bii_Equ_cx_Node_Ptr = &(dFdx[li_bii][A_bii_Equ_cx_NodeOffset]);
  q_bii_Equ_cx_Node_Ptr = &(dQdx[li_bii][A_bii_Equ_cx_NodeOffset]);
  f_ci_Equ_ti_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_ti_NodeOffset]);
  q_ci_Equ_ti_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_ti_NodeOffset]);
  f_ci_Equ_bi_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_bi_NodeOffset]);
  q_ci_Equ_bi_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_bi_NodeOffset]);
  f_ci_Equ_ci_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_ci_NodeOffset]);
  q_ci_Equ_ci_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_ci_NodeOffset]);
  f_ci_Equ_bii_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_bii_NodeOffset]);
  q_ci_Equ_bii_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_bii_NodeOffset]);
  f_ci_Equ_ei_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_ei_NodeOffset]);
  q_ci_Equ_ei_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_ei_NodeOffset]);
  f_ci_Equ_cx_Node_Ptr = &(dFdx[li_ci][A_ci_Equ_cx_NodeOffset]);
  q_ci_Equ_cx_Node_Ptr = &(dQdx[li_ci][A_ci_Equ_cx_NodeOffset]);
  f_ci_Equ_BRA_c_ci_Var_Ptr = &(dFdx[li_ci][A_ci_Equ_BRA_c_ci_Var_Offset]);
  q_ci_Equ_BRA_c_ci_Var_Ptr = &(dQdx[li_ci][A_ci_Equ_BRA_c_ci_Var_Offset]);
  f_ti_Equ_bi_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_bi_NodeOffset]);
  q_ti_Equ_bi_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_bi_NodeOffset]);
  f_ti_Equ_ci_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_ci_NodeOffset]);
  q_ti_Equ_ci_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_ci_NodeOffset]);
  f_ti_Equ_ei_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_ei_NodeOffset]);
  q_ti_Equ_ei_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_ei_NodeOffset]);
  f_ti_Equ_bii_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_bii_NodeOffset]);
  q_ti_Equ_bii_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_bii_NodeOffset]);
  f_ti_Equ_ti_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_ti_NodeOffset]);
  q_ti_Equ_ti_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_ti_NodeOffset]);
  f_ti_Equ_t_Node_Ptr = &(dFdx[li_ti][A_ti_Equ_t_NodeOffset]);
  q_ti_Equ_t_Node_Ptr = &(dQdx[li_ti][A_ti_Equ_t_NodeOffset]);
  f_ex_Equ_ti_Node_Ptr = &(dFdx[li_ex][A_ex_Equ_ti_NodeOffset]);
  q_ex_Equ_ti_Node_Ptr = &(dQdx[li_ex][A_ex_Equ_ti_NodeOffset]);
  f_ex_Equ_ex_Node_Ptr = &(dFdx[li_ex][A_ex_Equ_ex_NodeOffset]);
  q_ex_Equ_ex_Node_Ptr = &(dQdx[li_ex][A_ex_Equ_ex_NodeOffset]);
  f_ex_Equ_ei_Node_Ptr = &(dFdx[li_ex][A_ex_Equ_ei_NodeOffset]);
  q_ex_Equ_ei_Node_Ptr = &(dQdx[li_ex][A_ex_Equ_ei_NodeOffset]);
  f_ex_Equ_bii_Node_Ptr = &(dFdx[li_ex][A_ex_Equ_bii_NodeOffset]);
  q_ex_Equ_bii_Node_Ptr = &(dQdx[li_ex][A_ex_Equ_bii_NodeOffset]);
  f_exx_Equ_ti_Node_Ptr = &(dFdx[li_exx][A_exx_Equ_ti_NodeOffset]);
  q_exx_Equ_ti_Node_Ptr = &(dQdx[li_exx][A_exx_Equ_ti_NodeOffset]);
  f_exx_Equ_exx_Node_Ptr = &(dFdx[li_exx][A_exx_Equ_exx_NodeOffset]);
  q_exx_Equ_exx_Node_Ptr = &(dQdx[li_exx][A_exx_Equ_exx_NodeOffset]);
  f_exx_Equ_ei_Node_Ptr = &(dFdx[li_exx][A_exx_Equ_ei_NodeOffset]);
  q_exx_Equ_ei_Node_Ptr = &(dQdx[li_exx][A_exx_Equ_ei_NodeOffset]);
  f_exx_Equ_bii_Node_Ptr = &(dFdx[li_exx][A_exx_Equ_bii_NodeOffset]);
  q_exx_Equ_bii_Node_Ptr = &(dQdx[li_exx][A_exx_Equ_bii_NodeOffset]);
  f_cx_Equ_ti_Node_Ptr = &(dFdx[li_cx][A_cx_Equ_ti_NodeOffset]);
  q_cx_Equ_ti_Node_Ptr = &(dQdx[li_cx][A_cx_Equ_ti_NodeOffset]);
  f_cx_Equ_cx_Node_Ptr = &(dFdx[li_cx][A_cx_Equ_cx_NodeOffset]);
  q_cx_Equ_cx_Node_Ptr = &(dQdx[li_cx][A_cx_Equ_cx_NodeOffset]);
  f_cx_Equ_ci_Node_Ptr = &(dFdx[li_cx][A_cx_Equ_ci_NodeOffset]);
  q_cx_Equ_ci_Node_Ptr = &(dQdx[li_cx][A_cx_Equ_ci_NodeOffset]);
  f_cx_Equ_bii_Node_Ptr = &(dFdx[li_cx][A_cx_Equ_bii_NodeOffset]);
  q_cx_Equ_bii_Node_Ptr = &(dQdx[li_cx][A_cx_Equ_bii_NodeOffset]);
  f_BRA_b_bi_Equ_b_Node_Ptr = &(dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_b_Node_Offset]);
  q_BRA_b_bi_Equ_b_Node_Ptr =  &(dQdx[li_BRA_b_bi][A_BRA_b_bi_Equ_b_Node_Offset]);
  f_BRA_b_bi_Equ_bi_Node_Ptr = &(dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_bi_Node_Offset]);
  q_BRA_b_bi_Equ_bi_Node_Ptr =  &(dQdx[li_BRA_b_bi][A_BRA_b_bi_Equ_bi_Node_Offset]);
  f_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr=&(dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset]);
  q_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr=&(dQdx[li_BRA_b_bi][A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset]);
  f_BRA_e_ei_Equ_e_Node_Ptr = &(dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_e_Node_Offset]);
  q_BRA_e_ei_Equ_e_Node_Ptr =  &(dQdx[li_BRA_e_ei][A_BRA_e_ei_Equ_e_Node_Offset]);
  f_BRA_e_ei_Equ_ei_Node_Ptr = &(dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_ei_Node_Offset]);
  q_BRA_e_ei_Equ_ei_Node_Ptr =  &(dQdx[li_BRA_e_ei][A_BRA_e_ei_Equ_ei_Node_Offset]);
  f_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr=&(dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset]);
  q_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr=&(dQdx[li_BRA_e_ei][A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset]);
  f_BRA_c_ci_Equ_c_Node_Ptr = &(dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_c_Node_Offset]);
  q_BRA_c_ci_Equ_c_Node_Ptr =  &(dQdx[li_BRA_c_ci][A_BRA_c_ci_Equ_c_Node_Offset]);
  f_BRA_c_ci_Equ_ci_Node_Ptr = &(dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_ci_Node_Offset]);
  q_BRA_c_ci_Equ_ci_Node_Ptr =  &(dQdx[li_BRA_c_ci][A_BRA_c_ci_Equ_ci_Node_Offset]);
  f_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr=&(dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset]);
  q_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr=&(dQdx[li_BRA_c_ci][A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset]);


}

// RHS load functions

//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEFVector
// Purpose       : load F vector (static contributions) for one instance for
//                 NEW DAE formulation
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEFVector()
{

  bool bsuccess=true;
  (*extData.daeFVectorPtr)[li_c] += staticContributions[admsNodeID_c];
  (*extData.daeFVectorPtr)[li_b] += staticContributions[admsNodeID_b];
  (*extData.daeFVectorPtr)[li_e] += staticContributions[admsNodeID_e];
  (*extData.daeFVectorPtr)[li_t] += staticContributions[admsNodeID_t];
  (*extData.daeFVectorPtr)[li_ei] += staticContributions[admsNodeID_ei];
  (*extData.daeFVectorPtr)[li_bi] += staticContributions[admsNodeID_bi];
  (*extData.daeFVectorPtr)[li_bii] += staticContributions[admsNodeID_bii];
  (*extData.daeFVectorPtr)[li_ci] += staticContributions[admsNodeID_ci];
  (*extData.daeFVectorPtr)[li_ti] += staticContributions[admsNodeID_ti];
  (*extData.daeFVectorPtr)[li_ex] += staticContributions[admsNodeID_ex];
  (*extData.daeFVectorPtr)[li_exx] += staticContributions[admsNodeID_exx];
  (*extData.daeFVectorPtr)[li_cx] += staticContributions[admsNodeID_cx];

  (*extData.daeFVectorPtr)[li_BRA_b_bi] += staticContributions[admsBRA_ID_b_bi];
  (*extData.daeFVectorPtr)[li_BRA_e_ei] += staticContributions[admsBRA_ID_e_ei];
  (*extData.daeFVectorPtr)[li_BRA_c_ci] += staticContributions[admsBRA_ID_c_ci];
  if (getDeviceOptions().voltageLimiterFlag && !origFlag)
  {
    double *dFdxdVp = extData.dFdxdVpVectorRawPtr;
    dFdxdVp[li_c] += Jdxp_static[admsNodeID_c];
    dFdxdVp[li_b] += Jdxp_static[admsNodeID_b];
    dFdxdVp[li_e] += Jdxp_static[admsNodeID_e];
    dFdxdVp[li_t] += Jdxp_static[admsNodeID_t];
    dFdxdVp[li_ei] += Jdxp_static[admsNodeID_ei];
    dFdxdVp[li_bi] += Jdxp_static[admsNodeID_bi];
    dFdxdVp[li_bii] += Jdxp_static[admsNodeID_bii];
    dFdxdVp[li_ci] += Jdxp_static[admsNodeID_ci];
    dFdxdVp[li_ti] += Jdxp_static[admsNodeID_ti];
    dFdxdVp[li_ex] += Jdxp_static[admsNodeID_ex];
    dFdxdVp[li_exx] += Jdxp_static[admsNodeID_exx];
    dFdxdVp[li_cx] += Jdxp_static[admsNodeID_cx];

    dFdxdVp[li_BRA_b_bi] += Jdxp_static[admsBRA_ID_b_bi];
    dFdxdVp[li_BRA_e_ei] += Jdxp_static[admsBRA_ID_e_ei];
    dFdxdVp[li_BRA_c_ci] += Jdxp_static[admsBRA_ID_c_ci];

  }

  if (loadLeadCurrent)
  {
    double * leadF = extData.nextLeadCurrFCompRawPtr;
    leadF[li_branch_ic] = leadCurrentF[admsNodeID_c];
    leadF[li_branch_ib] = leadCurrentF[admsNodeID_b];
    leadF[li_branch_ie] = leadCurrentF[admsNodeID_e];
    leadF[li_branch_it] = leadCurrentF[admsNodeID_t];



    // here we have to do special things for BJTs, MOSFETs and 2-terminal
    // devices for power computation.

    double * solVec = extData.nextSolVectorRawPtr;
    double * junctionV = extData.nextJunctionVCompRawPtr;
    junctionV[li_branch_ic] = solVec[li_c] - solVec[li_e];
    junctionV[li_branch_ib] = solVec[li_b] - solVec[li_e];

  }
  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEQVector
// Purpose       : load Q vector (dynamic contributions) for one instance for
//                 NEW DAE formulation
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEQVector()
{
  (*extData.daeQVectorPtr)[li_c] += dynamicContributions[admsNodeID_c];
  (*extData.daeQVectorPtr)[li_b] += dynamicContributions[admsNodeID_b];
  (*extData.daeQVectorPtr)[li_e] += dynamicContributions[admsNodeID_e];
  (*extData.daeQVectorPtr)[li_t] += dynamicContributions[admsNodeID_t];
  (*extData.daeQVectorPtr)[li_ei] += dynamicContributions[admsNodeID_ei];
  (*extData.daeQVectorPtr)[li_bi] += dynamicContributions[admsNodeID_bi];
  (*extData.daeQVectorPtr)[li_bii] += dynamicContributions[admsNodeID_bii];
  (*extData.daeQVectorPtr)[li_ci] += dynamicContributions[admsNodeID_ci];
  (*extData.daeQVectorPtr)[li_ti] += dynamicContributions[admsNodeID_ti];
  (*extData.daeQVectorPtr)[li_ex] += dynamicContributions[admsNodeID_ex];
  (*extData.daeQVectorPtr)[li_exx] += dynamicContributions[admsNodeID_exx];
  (*extData.daeQVectorPtr)[li_cx] += dynamicContributions[admsNodeID_cx];

  (*extData.daeQVectorPtr)[li_BRA_b_bi] += dynamicContributions[admsBRA_ID_b_bi];
  (*extData.daeQVectorPtr)[li_BRA_e_ei] += dynamicContributions[admsBRA_ID_e_ei];
  (*extData.daeQVectorPtr)[li_BRA_c_ci] += dynamicContributions[admsBRA_ID_c_ci];
  if (getDeviceOptions().voltageLimiterFlag && !origFlag)
  {
    double *dQdxdVp = extData.dQdxdVpVectorRawPtr;
    dQdxdVp[li_c] += Jdxp_dynamic[admsNodeID_c];
    dQdxdVp[li_b] += Jdxp_dynamic[admsNodeID_b];
    dQdxdVp[li_e] += Jdxp_dynamic[admsNodeID_e];
    dQdxdVp[li_t] += Jdxp_dynamic[admsNodeID_t];
    dQdxdVp[li_ei] += Jdxp_dynamic[admsNodeID_ei];
    dQdxdVp[li_bi] += Jdxp_dynamic[admsNodeID_bi];
    dQdxdVp[li_bii] += Jdxp_dynamic[admsNodeID_bii];
    dQdxdVp[li_ci] += Jdxp_dynamic[admsNodeID_ci];
    dQdxdVp[li_ti] += Jdxp_dynamic[admsNodeID_ti];
    dQdxdVp[li_ex] += Jdxp_dynamic[admsNodeID_ex];
    dQdxdVp[li_exx] += Jdxp_dynamic[admsNodeID_exx];
    dQdxdVp[li_cx] += Jdxp_dynamic[admsNodeID_cx];

    dQdxdVp[li_BRA_b_bi] += Jdxp_dynamic[admsBRA_ID_b_bi];
    dQdxdVp[li_BRA_e_ei] += Jdxp_dynamic[admsBRA_ID_e_ei];
    dQdxdVp[li_BRA_c_ci] += Jdxp_dynamic[admsBRA_ID_c_ci];
  }

  if (loadLeadCurrent)
  {
    double * leadQ = extData.nextLeadCurrQCompRawPtr;
    leadQ[li_branch_ic] = leadCurrentQ[admsNodeID_c];
    leadQ[li_branch_ib] = leadCurrentQ[admsNodeID_b];
    leadQ[li_branch_ie] = leadCurrentQ[admsNodeID_e];
    leadQ[li_branch_it] = leadCurrentQ[admsNodeID_t];


  }
  return true;
}


//-----------------------------------------------------------------------------
// Function      : Instance::updatePrimaryState
// Purpose       :
// Special Notes : In this initial implementation, does little more than
//                 call updateIntermediateVars()
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updatePrimaryState()
{
  bool bsuccess = true;

  bsuccess = updateIntermediateVars();

  // if old DAE were implemented, we'd save dynamic contributions as state
  // here.

  double * stoVec = extData.nextStoVectorRawPtr;
  // Also need to save limited voltage drops and output vars
  // This formulation assumes that we have *always* written the
  // limited voltages back into the probeVars[] array.

  stoVec[li_store_admsProbeID_V_bi_ci] = probeVars[admsProbeID_V_bi_ci];
  stoVec[li_store_admsProbeID_V_bii_ci] = probeVars[admsProbeID_V_bii_ci];
  stoVec[li_store_admsProbeID_V_bii_ei] = probeVars[admsProbeID_V_bii_ei];

  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::updateSecondaryState
// Purpose       :
// Special Notes : In this initial implementation, does nothing
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateSecondaryState()
{
  bool bsuccess = true;

  // were old DAE implemented, we'd pull dynamic contribution derivatives
  // out of state.

  return bsuccess;
}

//-----------------------------------------------------------------------------
// Function      : Instance::updateIntermediateVars
// Purpose       : update intermediate variables for one HBT_X instance
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateIntermediateVars()
{

  bool bsuccess=true;
  Linear::Vector * solVectorPtr = extData.nextSolVectorPtr;

  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
  {
    Xyce::dout() << std::endl << subsection_divider << std::endl;
    Xyce::dout() << "  In ADMSHBT_X::Instance::updateIntermediateVars\n\n";
    Xyce::dout() << "  name = " << getName() << std::endl;
  }

  // Local variables
  double qbe=0.0;
  double d_qbe_dV_bii_ei=0.0;
  double d_qbe_dV_ti_GND=0.0;
  double d_qbe_dV_bii_ci=0.0;
  double d_qbe_dV_ci_ei=0.0;
  double qbtf=0.0;
  double d_qbtf_dV_ti_GND=0.0;
  double d_qbtf_dV_bii_ei=0.0;
  double d_qbtf_dV_bii_ci=0.0;
  double xtff=0.0;
  double d_xtff_dV_bii_ei=0.0;
  double d_xtff_dV_ti_GND=0.0;
  double d_xtff_dV_bii_ci=0.0;
  double d_xtff_dV_ci_ei=0.0;
  double Wh=0.0;
  double d_Wh_dV_ci_ei=0.0;
  double d_Wh_dV_bii_ei=0.0;
  double d_Wh_dV_ti_GND=0.0;
  double d_Wh_dV_bii_ci=0.0;
  double Ih=0.0;
  double d_Ih_dV_ci_ei=0.0;
  double d_Ih_dV_bii_ei=0.0;
  double d_Ih_dV_ti_GND=0.0;
  double d_Ih_dV_bii_ci=0.0;
  double AHC=0.0;
  double RCIO=0.0;
  double InvVpt=0.0;
  double Vlim=0.0;
  double qb2=0.0;
  double d_qb2_dV_bii_ei=0.0;
  double d_qb2_dV_ti_GND=0.0;
  double d_qb2_dV_bii_ci=0.0;
  double qbtra=0.0;
  double d_qbtra_dV_bi_ci=0.0;
  double d_qbtra_dV_ti_GND=0.0;
  double qbtr=0.0;
  double d_qbtr_dV_bii_ci=0.0;
  double d_qbtr_dV_ti_GND=0.0;
  double d_qbtr_dV_bii_ei=0.0;
  double qb1=0.0;
  double d_qb1_dV_bi_ci=0.0;
  double qb2med=0.0;
  double d_qb2med_dV_bii_ei=0.0;
  double d_qb2med_dV_ti_GND=0.0;
  double d_qb2med_dV_bii_ci=0.0;
  double xix=0.0;
  double d_xix_dV_bii_ei=0.0;
  double d_xix_dV_ti_GND=0.0;
  double d_xix_dV_bii_ci=0.0;
  double I00=0.0;
  double Ipdiss=0.0;
  double d_Ipdiss_dV_bii_ei=0.0;
  double d_Ipdiss_dV_ti_GND=0.0;
  double d_Ipdiss_dV_bii_ci=0.0;
  double d_Ipdiss_dV_ci_ei=0.0;
  double d_Ipdiss_dV_bi_ci=0.0;
  double Icdx=0.0;
  double d_Icdx_dV_cx_ci=0.0;
  double d_Icdx_dV_ti_GND=0.0;
  double Ibdxx=0.0;
  double d_Ibdxx_dV_exx_ei=0.0;
  double d_Ibdxx_dV_ti_GND=0.0;
  double Ibdx=0.0;
  double d_Ibdx_dV_ex_ei=0.0;
  double d_Ibdx_dV_ti_GND=0.0;
  double Ib1=0.0;
  double d_Ib1_dV_bii_ei=0.0;
  double d_Ib1_dV_ti_GND=0.0;
  double d_Ib1_dV_bii_ci=0.0;
  double Ib0=0.0;
  double d_Ib0_dV_bii_ei=0.0;
  double d_Ib0_dV_ti_GND=0.0;
  double d_Ib0_dV_bii_ci=0.0;
  double EdBeta=0.0;
  double d_EdBeta_dV_ti_GND=0.0;
  double d_EdBeta_dV_bii_ci=0.0;
  double mm=0.0;
  double d_mm_dV_bii_ci=0.0;
  double Vbclin=0.0;
  double epsi=0.0;
  double Ibx=0.0;
  double d_Ibx_dV_bi_ci=0.0;
  double d_Ibx_dV_ti_GND=0.0;
  double Ib2=0.0;
  double d_Ib2_dV_bii_ci=0.0;
  double d_Ib2_dV_ti_GND=0.0;
  double Ic1=0.0;
  double d_Ic1_dV_bii_ei=0.0;
  double d_Ic1_dV_ti_GND=0.0;
  double d_Ic1_dV_bii_ci=0.0;
  double Ic1r=0.0;
  double d_Ic1r_dV_bii_ci=0.0;
  double d_Ic1r_dV_ti_GND=0.0;
  double d_Ic1r_dV_bii_ei=0.0;
  double Ic0=0.0;
  double d_Ic0_dV_bii_ei=0.0;
  double d_Ic0_dV_ti_GND=0.0;
  double d_Ic0_dV_bii_ci=0.0;
  double qb=0.0;
  double d_qb_dV_bii_ei=0.0;
  double d_qb_dV_bii_ci=0.0;
  double d_qb_dV_ti_GND=0.0;
  double q2=0.0;
  double d_q2_dV_bii_ei=0.0;
  double d_q2_dV_ti_GND=0.0;
  double d_q2_dV_bii_ci=0.0;
  double q1=0.0;
  double d_q1_dV_bii_ei=0.0;
  double d_q1_dV_bii_ci=0.0;
  double Ic1ra=0.0;
  double d_Ic1ra_dV_bii_ci=0.0;
  double d_Ic1ra_dV_ti_GND=0.0;
  double Ic0a=0.0;
  double d_Ic0a_dV_bii_ei=0.0;
  double d_Ic0a_dV_ti_GND=0.0;
  double TWO_Q=0.0;
  double FOUR_K=0.0;
  double Area=0.0;
  double Tex=0.0;
  double d_Tex_dV_ti_GND=0.0;
  double TjK=0.0;
  double Tj=0.0;
  double d_Tj_dV_ti_GND=0.0;
  double Texi=0.0;
  double d_Texi_dV_ti_GND=0.0;
  double vcei=0.0;
  double d_vcei_dV_ci_ei=0.0;
  double vxxe=0.0;
  double d_vxxe_dV_exx_ei=0.0;
  double vxc=0.0;
  double d_vxc_dV_cx_ci=0.0;
  double vxe=0.0;
  double d_vxe_dV_ex_ei=0.0;
  double vbei=0.0;
  double d_vbei_dV_bii_ei=0.0;
  double vbci=0.0;
  double d_vbci_dV_bii_ci=0.0;
  double vbcx=0.0;
  double d_vbcx_dV_bi_ci=0.0;
  double tVCrit=0.0;
  // temporary variables for limiting
  double vbei_orig,vbei_limited,vbei_old;
  double vbci_orig,vbci_limited,vbci_old;
  double vbcx_orig,vbcx_limited,vbcx_old;


  // set the sizes of the Fad arrays:

  if (probeVars.size() != (19))
  {
    probeVars.resize(19);
    d_probeVars.resize(19);
    for (int i=0;i<19;i++)
    {
      d_probeVars[i].resize(19);
      for (int j=0;j<19;j++)
        d_probeVars[i][j]=0.0;
    }
    staticContributions.resize(12+3);
    d_staticContributions.resize(12+3);
    for (int i=0;i<12+3;i++)
      d_staticContributions[i].resize(19);
    dynamicContributions.resize(12+3);
    d_dynamicContributions.resize(12+3);
    for (int i=0;i<12+3;i++)
      d_dynamicContributions[i].resize(19);
    probeDiffs.resize(19,0.0);
    Jdxp_static.resize(12+3);
    Jdxp_dynamic.resize(12+3);
  }


  // initialize contributions to zero (automatically sets derivatives to zero)
  for (int i=0; i < 12+3 ; ++i)
  {
    staticContributions[i]=0;
    for (int j=0;j<19;j++)
      d_staticContributions[i][j] = 0.0;
    dynamicContributions[i]=0;
    for (int j=0;j<19;j++)
      d_dynamicContributions[i][j] = 0.0;
    Jdxp_static[i]=0;
    Jdxp_dynamic[i]=0;
  }

  for (int i=0; i < 19 ; ++i)
  {
    probeDiffs[i] = 0.0;
  }
  // extract solution variables and set as Fad independent variables.
  probeVars[admsProbeID_V_t_ti] = (*solVectorPtr)[li_t] - (*solVectorPtr)[li_ti];
  d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti] = 1.0;
  probeVars[admsProbeID_V_b_c] = (*solVectorPtr)[li_b] - (*solVectorPtr)[li_c];
  d_probeVars[admsProbeID_V_b_c][admsProbeID_V_b_c] = 1.0;
  probeVars[admsProbeID_V_c_GND] = (*solVectorPtr)[li_c];
  d_probeVars[admsProbeID_V_c_GND][admsProbeID_V_c_GND] = 1.0;
  probeVars[admsProbeID_V_b_GND] = (*solVectorPtr)[li_b];
  d_probeVars[admsProbeID_V_b_GND][admsProbeID_V_b_GND] = 1.0;
  probeVars[admsProbeID_V_cx_bii] = (*solVectorPtr)[li_cx] - (*solVectorPtr)[li_bii];
  d_probeVars[admsProbeID_V_cx_bii][admsProbeID_V_cx_bii] = 1.0;
  probeVars[admsProbeID_V_exx_bii] = (*solVectorPtr)[li_exx] - (*solVectorPtr)[li_bii];
  d_probeVars[admsProbeID_V_exx_bii][admsProbeID_V_exx_bii] = 1.0;
  probeVars[admsProbeID_V_ex_bii] = (*solVectorPtr)[li_ex] - (*solVectorPtr)[li_bii];
  d_probeVars[admsProbeID_V_ex_bii][admsProbeID_V_ex_bii] = 1.0;
  probeVars[admsProbeID_V_bii_bi] = (*solVectorPtr)[li_bii] - (*solVectorPtr)[li_bi];
  d_probeVars[admsProbeID_V_bii_bi][admsProbeID_V_bii_bi] = 1.0;
  probeVars[admsProbeID_I_c_ci] = (*solVectorPtr)[li_BRA_c_ci];
  d_probeVars[admsProbeID_I_c_ci][admsProbeID_I_c_ci] = 1.0;
  probeVars[admsProbeID_I_e_ei] = (*solVectorPtr)[li_BRA_e_ei];
  d_probeVars[admsProbeID_I_e_ei][admsProbeID_I_e_ei] = 1.0;
  probeVars[admsProbeID_I_b_bi] = (*solVectorPtr)[li_BRA_b_bi];
  d_probeVars[admsProbeID_I_b_bi][admsProbeID_I_b_bi] = 1.0;
  probeVars[admsProbeID_V_ti_GND] = (*solVectorPtr)[li_ti];
  d_probeVars[admsProbeID_V_ti_GND][admsProbeID_V_ti_GND] = 1.0;
  probeVars[admsProbeID_V_ci_ei] = (*solVectorPtr)[li_ci] - (*solVectorPtr)[li_ei];
  d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei] = 1.0;
  probeVars[admsProbeID_V_exx_ei] = (*solVectorPtr)[li_exx] - (*solVectorPtr)[li_ei];
  d_probeVars[admsProbeID_V_exx_ei][admsProbeID_V_exx_ei] = 1.0;
  probeVars[admsProbeID_V_cx_ci] = (*solVectorPtr)[li_cx] - (*solVectorPtr)[li_ci];
  d_probeVars[admsProbeID_V_cx_ci][admsProbeID_V_cx_ci] = 1.0;
  probeVars[admsProbeID_V_ex_ei] = (*solVectorPtr)[li_ex] - (*solVectorPtr)[li_ei];
  d_probeVars[admsProbeID_V_ex_ei][admsProbeID_V_ex_ei] = 1.0;
  probeVars[admsProbeID_V_bii_ei] = (*solVectorPtr)[li_bii] - (*solVectorPtr)[li_ei];
  d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei] = 1.0;
  probeVars[admsProbeID_V_bii_ci] = (*solVectorPtr)[li_bii] - (*solVectorPtr)[li_ci];
  d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci] = 1.0;
  probeVars[admsProbeID_V_bi_ci] = (*solVectorPtr)[li_bi] - (*solVectorPtr)[li_ci];
  d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci] = 1.0;


  // pre-multiply any "typed" probes (i.e. those limited with "typedpnjlim")
  probeVars[admsProbeID_V_bii_ei] *= (model_.dtype);
  d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei] *= (model_.dtype);
  probeVars[admsProbeID_V_bii_ci] *= (model_.dtype);
  d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci] *= (model_.dtype);
  probeVars[admsProbeID_V_bi_ci] *= (model_.dtype);
  d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci] *= (model_.dtype);

  // Copy probes into limiting vars

  vbei_orig = vbei_limited = probeVars[admsProbeID_V_bii_ei];
  probeDiffs[admsProbeID_V_bii_ei] = 0.0;
  vbci_orig = vbci_limited = probeVars[admsProbeID_V_bii_ci];
  probeDiffs[admsProbeID_V_bii_ci] = 0.0;
  vbcx_orig = vbcx_limited = probeVars[admsProbeID_V_bi_ci];
  probeDiffs[admsProbeID_V_bi_ci] = 0.0;

  origFlag = true;

  // Manually moved from below
  {
    double value_log_0 = log((adms_vt_nom/(1.41421356237309504880*(((((model_.Jsf)*L)*W)*N)*1e12))));
    tVCrit = (adms_vt_nom*value_log_0);
  }
  if (getSolverState().newtonIter == 0)
  {

    if (getSolverState().initJctFlag_ && getDeviceOptions().voltageLimiterFlag)
    {
      // manually inserted code:
      if (getSolverState().inputOPFlag)
      {
        Linear::Vector * flagSolVectorPtr = (extData.flagSolVectorPtr);
        if ((*flagSolVectorPtr)[li_e] == 0 ||
            (*flagSolVectorPtr)[li_ei] == 0 ||
            (*flagSolVectorPtr)[li_ex] == 0 ||
            (*flagSolVectorPtr)[li_exx] == 0 ||
            (*flagSolVectorPtr)[li_b] == 0 ||
            (*flagSolVectorPtr)[li_bi] == 0 ||
            (*flagSolVectorPtr)[li_bii] == 0 ||
            (*flagSolVectorPtr)[li_c] == 0 ||
            (*flagSolVectorPtr)[li_ci] == 0 ||
            (*flagSolVectorPtr)[li_cx] == 0 ||
            (*flagSolVectorPtr)[li_t] == 0 ||
            (*flagSolVectorPtr)[li_ti] == 0 )
        {
          vbcx_limited = vbci_limited = 0;
          vbei_limited = tVCrit;
          origFlag = false;
        }
      }
      else
      {
        vbcx_limited = vbci_limited = 0;
        vbei_limited = tVCrit;
        origFlag = false;
        if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
        {
          Xyce::dout() << " Setting device initial condition to Base-Emitter drop=tVCri (" << tVCrit << ")" << std::endl;
        }
      }
    }
    // end manually inserted code

    if (!(getSolverState().dcopFlag)||(getSolverState().locaEnabledFlag && getSolverState().dcopFlag))
    {
      vbei_old = ((*extData.currStoVectorPtr))[li_store_admsProbeID_V_bii_ei];
      vbci_old = ((*extData.currStoVectorPtr))[li_store_admsProbeID_V_bii_ci];
      vbcx_old = ((*extData.currStoVectorPtr))[li_store_admsProbeID_V_bi_ci];
    }
    else
    {
      vbei_old = vbei_limited;
      vbci_old = vbci_limited;
      vbcx_old = vbcx_limited;
    }
  }
  else
  {
    vbei_old = ((*extData.nextStoVectorPtr))[li_store_admsProbeID_V_bii_ei];
    vbci_old = ((*extData.nextStoVectorPtr))[li_store_admsProbeID_V_bii_ci];
    vbcx_old = ((*extData.nextStoVectorPtr))[li_store_admsProbeID_V_bi_ci];
  }
  // -- code converted from analog/code block
  // Manually moved to above
  //{
  //  double value_log_0 = log((adms_vt_nom/(1.41421356237309504880*(((((model_.Jsf)*L)*W)*N)*1e12))));
  //  tVCrit = (adms_vt_nom*value_log_0);
  //}


  //vbcx = ($limit(V(bi,ci),"typedpnjlim",$vt(),tVCrit,dtype));
  if (getDeviceOptions().voltageLimiterFlag)
  {
    int icheck=0;
    vbcx_limited = devSupport.pnjlim(vbcx_limited,vbcx_old,adms_vt_nom,tVCrit,&icheck);
    if (icheck == 1)
      origFlag = false;
    if (!origFlag)
    {
      probeDiffs[admsProbeID_V_bi_ci] = vbcx_limited - vbcx_orig;
      probeVars[admsProbeID_V_bi_ci] += probeDiffs[admsProbeID_V_bi_ci];
    }
  }
  vbcx = probeVars[admsProbeID_V_bi_ci];

  d_vbcx_dV_bi_ci = d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];



  //vbci = ($limit(V(bii,ci),"typedpnjlim",$vt(),tVCrit,dtype));
  if (getDeviceOptions().voltageLimiterFlag)
  {
    int icheck=0;
    vbci_limited = devSupport.pnjlim(vbci_limited,vbci_old,adms_vt_nom,tVCrit,&icheck);
    if (icheck == 1)
      origFlag = false;
    if (!origFlag)
    {
      probeDiffs[admsProbeID_V_bii_ci] = vbci_limited - vbci_orig;
      probeVars[admsProbeID_V_bii_ci] += probeDiffs[admsProbeID_V_bii_ci];
    }
  }
  vbci = probeVars[admsProbeID_V_bii_ci];

  d_vbci_dV_bii_ci = d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci];



  //vbei = ($limit(V(bii,ei),"typedpnjlim",$vt(),tVCrit,dtype));
  if (getDeviceOptions().voltageLimiterFlag)
  {
    int icheck=0;
    vbei_limited = devSupport.pnjlim(vbei_limited,vbei_old,adms_vt_nom,tVCrit,&icheck);
    if (icheck == 1)
      origFlag = false;
    if (!origFlag)
    {
      probeDiffs[admsProbeID_V_bii_ei] = vbei_limited - vbei_orig;
      probeVars[admsProbeID_V_bii_ei] += probeDiffs[admsProbeID_V_bii_ei];
    }
  }
  vbei = probeVars[admsProbeID_V_bii_ei];

  d_vbei_dV_bii_ei = d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];


  d_vxe_dV_ex_ei = (model_.dtype)*d_probeVars[admsProbeID_V_ex_ei][admsProbeID_V_ex_ei];
  vxe = ((model_.dtype)*(probeVars[admsProbeID_V_ex_ei]));

  d_vxc_dV_cx_ci = (model_.dtype)*d_probeVars[admsProbeID_V_cx_ci][admsProbeID_V_cx_ci];
  vxc = ((model_.dtype)*(probeVars[admsProbeID_V_cx_ci]));

  d_vxxe_dV_exx_ei = (model_.dtype)*d_probeVars[admsProbeID_V_exx_ei][admsProbeID_V_exx_ei];
  vxxe = ((model_.dtype)*(probeVars[admsProbeID_V_exx_ei]));

  d_vcei_dV_ci_ei = (model_.dtype)*d_probeVars[admsProbeID_V_ci_ei][admsProbeID_V_ci_ei];
  vcei = ((model_.dtype)*(probeVars[admsProbeID_V_ci_ei]));

  d_Texi_dV_ti_GND = d_probeVars[admsProbeID_V_ti_GND][admsProbeID_V_ti_GND];
  Texi = (probeVars[admsProbeID_V_ti_GND]);

  d_Tj_dV_ti_GND = d_Texi_dV_ti_GND;
  Tj = (Texi+Temp);
  TjK = (Tj+273.15);

  d_Tex_dV_ti_GND = d_Tj_dV_ti_GND;
  Tex = (Tj-(model_.Tnom));
  Area = (((L*W)*1.0e12)*N);
  FOUR_K = (4*1.3806226e-23);
  TWO_Q = (2*1.6021918e-19);
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbei,(model_.Jsf),(model_.Vg),(model_.nf),Area,Tj,(model_.Tnom));

    d_Ic0a_dV_ti_GND = evaluator_diode_0.getDerivs(vbei,(model_.Jsf),(model_.Vg),(model_.nf),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0);
    d_Ic0a_dV_bii_ei = evaluator_diode_0.getDerivs(vbei,(model_.Jsf),(model_.Vg),(model_.nf),Area,Tj,(model_.Tnom),d_vbei_dV_bii_ei,0.0,0.0,0.0,0.0,0.0,0.0);
    Ic0a = evaluator_diode_0.getValues(vbei,(model_.Jsf),(model_.Vg),(model_.nf),Area,Tj,(model_.Tnom));
  }
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom));

    d_Ic1ra_dV_ti_GND = evaluator_diode_0.getDerivs(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0);
    d_Ic1ra_dV_bii_ci = evaluator_diode_0.getDerivs(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0,0.0,0.0);
    Ic1ra = evaluator_diode_0.getValues(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom));
  }
  if ((((model_.VAF)>0.0)&&((model_.VAR)>0.0)))
  {
    {
      AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,1.0,(model_.Vje),(model_.mje),1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,(model_.Vje),(model_.mje),1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_2(vbci,1.0,(model_.Vjc),(model_.mjc),1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_3(0.0,1.0,(model_.Vjc),(model_.mjc),1.0);

      d_q1_dV_bii_ci = (evaluator_charge_2.getDerivs(vbci,1.0,(model_.Vjc),(model_.mjc),1.0,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)/(model_.VAF));
      d_q1_dV_bii_ei = (evaluator_charge_0.getDerivs(vbei,1.0,(model_.Vje),(model_.mje),1.0,d_vbei_dV_bii_ei,0.0,0.0,0.0,0.0)/(model_.VAR));
      q1 = ((1.0+((evaluator_charge_0.getValues(vbei,1.0,(model_.Vje),(model_.mje),1.0)-evaluator_charge_1.getValues(0.0,1.0,(model_.Vje),(model_.mje),1.0))/(model_.VAR)))+((evaluator_charge_2.getValues(vbci,1.0,(model_.Vjc),(model_.mjc),1.0)-evaluator_charge_3.getValues(0.0,1.0,(model_.Vjc),(model_.mjc),1.0))/(model_.VAF)));
    }
  }
  else
  {
    if ((((model_.VAF)>0.0)&&((model_.VAR)==0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,1.0,(model_.Vjc),(model_.mjc),1.0);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,(model_.Vjc),(model_.mjc),1.0);

        d_q1_dV_bii_ei =  0.0;
        d_q1_dV_bii_ci = (evaluator_charge_0.getDerivs(vbci,1.0,(model_.Vjc),(model_.mjc),1.0,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)/(model_.VAF));
        q1 = (1.0+((evaluator_charge_0.getValues(vbci,1.0,(model_.Vjc),(model_.mjc),1.0)-evaluator_charge_1.getValues(0.0,1.0,(model_.Vjc),(model_.mjc),1.0))/(model_.VAF)));
      }
    }
    else
    {
      if ((((model_.VAF)==0.0)&&((model_.VAR)>0.0)))
      {
        {
          AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,1.0,(model_.Vje),(model_.mje),1.0);
          AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,(model_.Vje),(model_.mje),1.0);

          d_q1_dV_bii_ci =  0.0;
          d_q1_dV_bii_ei = (evaluator_charge_0.getDerivs(vbei,1.0,(model_.Vje),(model_.mje),1.0,d_vbei_dV_bii_ei,0.0,0.0,0.0,0.0)/(model_.VAR));
          q1 = (1.0+((evaluator_charge_0.getValues(vbei,1.0,(model_.Vje),(model_.mje),1.0)-evaluator_charge_1.getValues(0.0,1.0,(model_.Vje),(model_.mje),1.0))/(model_.VAR)));
        }
      }
      else
      {

        d_q1_dV_bii_ei = d_q1_dV_bii_ci =  0.0;
        q1 = 1.0;
      }
    }
  }
  if ((((model_.IKF)>0.0)&&((model_.IKR)>0.0)))
  {

    d_q2_dV_bii_ci = (d_Ic1ra_dV_bii_ci/(Area*(model_.IKR)));
    d_q2_dV_ti_GND = ((d_Ic0a_dV_ti_GND/(Area*(model_.IKF)))+(d_Ic1ra_dV_ti_GND/(Area*(model_.IKR))));
    d_q2_dV_bii_ei = (d_Ic0a_dV_bii_ei/(Area*(model_.IKF)));
    q2 = ((Ic0a/(Area*(model_.IKF)))+(Ic1ra/(Area*(model_.IKR))));
  }
  else
  {
    if ((((model_.IKF)>0.0)&&((model_.IKR)==0.0)))
    {

      d_q2_dV_bii_ci =  0.0;
      d_q2_dV_ti_GND = (d_Ic0a_dV_ti_GND/(Area*(model_.IKF)));
      d_q2_dV_bii_ei = (d_Ic0a_dV_bii_ei/(Area*(model_.IKF)));
      q2 = (Ic0a/(Area*(model_.IKF)));
    }
    else
    {
      if ((((model_.IKF)==0.0)&&((model_.IKR)>0.0)))
      {

        d_q2_dV_bii_ei =  0.0;
        d_q2_dV_ti_GND = (d_Ic1ra_dV_ti_GND/(Area*(model_.IKR)));
        d_q2_dV_bii_ci = (d_Ic1ra_dV_bii_ci/(Area*(model_.IKR)));
        q2 = (Ic1ra/(Area*(model_.IKR)));
      }
      else
      {

        d_q2_dV_bii_ei = d_q2_dV_ti_GND = d_q2_dV_bii_ci =  0.0;
        q2 = 0.0;
      }
    }
  }
  {
    double value_sqrt_0 = sqrt(((q1*q1)+(4.0*q2)));
    double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);

    d_qb_dV_ti_GND = ((deriv_sqrt_0_d0*(4.0*d_q2_dV_ti_GND))/2.0);
    d_qb_dV_bii_ci = ((d_q1_dV_bii_ci+(deriv_sqrt_0_d0*(((q1*d_q1_dV_bii_ci+d_q1_dV_bii_ci*q1)+4.0*d_q2_dV_bii_ci))))/2.0);
    d_qb_dV_bii_ei = ((d_q1_dV_bii_ei+(deriv_sqrt_0_d0*(((q1*d_q1_dV_bii_ei+d_q1_dV_bii_ei*q1)+4.0*d_q2_dV_bii_ei))))/2.0);
    qb = ((q1+value_sqrt_0)/2.0);
  }

  d_Ic0_dV_bii_ci = (-Ic0a*d_qb_dV_bii_ci/qb/qb);
  d_Ic0_dV_ti_GND = ((qb*d_Ic0a_dV_ti_GND-Ic0a*d_qb_dV_ti_GND)/qb/qb);
  d_Ic0_dV_bii_ei = ((qb*d_Ic0a_dV_bii_ei-Ic0a*d_qb_dV_bii_ei)/qb/qb);
  Ic0 = (Ic0a/qb);

  d_Ic1r_dV_bii_ei = (-Ic1ra*d_qb_dV_bii_ei/qb/qb);
  d_Ic1r_dV_ti_GND = ((qb*d_Ic1ra_dV_ti_GND-Ic1ra*d_qb_dV_ti_GND)/qb/qb);
  d_Ic1r_dV_bii_ci = ((qb*d_Ic1ra_dV_bii_ci-Ic1ra*d_qb_dV_bii_ci)/qb/qb);
  Ic1r = (Ic1ra/qb);

  d_Ic1_dV_bii_ci = (d_Ic0_dV_bii_ci-d_Ic1r_dV_bii_ci);
  d_Ic1_dV_ti_GND = (d_Ic0_dV_ti_GND-d_Ic1r_dV_ti_GND);
  d_Ic1_dV_bii_ei = (d_Ic0_dV_bii_ei-d_Ic1r_dV_bii_ei);
  Ic1 = (Ic0-Ic1r);
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom));

    d_Ib2_dV_ti_GND = (evaluator_diode_0.getDerivs(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0)/(model_.Br));
    d_Ib2_dV_bii_ci = (evaluator_diode_0.getDerivs(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0,0.0,0.0)/(model_.Br));
    Ib2 = (evaluator_diode_0.getValues(vbci,((model_.XCjc)*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom))/(model_.Br));
  }
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbcx,((1.0-(model_.XCjc))*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom));

    d_Ibx_dV_ti_GND = (evaluator_diode_0.getDerivs(vbcx,((1.0-(model_.XCjc))*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0)/(model_.Br));
    d_Ibx_dV_bi_ci = (evaluator_diode_0.getDerivs(vbcx,((1.0-(model_.XCjc))*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom),d_vbcx_dV_bi_ci,0.0,0.0,0.0,0.0,0.0,0.0)/(model_.Br));
    Ibx = (evaluator_diode_0.getValues(vbcx,((1.0-(model_.XCjc))*(model_.Jsr)),(model_.Vgr),(model_.nr),Area,Tj,(model_.Tnom))/(model_.Br));
  }
  epsi = 1.0e-6;
  {
    double value_pow_0 = pow((1.0-epsi),(1/(model_.Mc)));
    Vbclin = ((model_.BVceo)*value_pow_0);
  }
  {
    AnalogFunctions::MMEvaluator evaluator_MM_0(vbci,(model_.BVceo),(model_.Mc),Vbclin,(model_.Bf),(model_.kc));

    d_mm_dV_bii_ci = evaluator_MM_0.getDerivs(vbci,(model_.BVceo),(model_.Mc),Vbclin,(model_.Bf),(model_.kc),d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0,0.0);
    mm = evaluator_MM_0.getValues(vbci,(model_.BVceo),(model_.Mc),Vbclin,(model_.Bf),(model_.kc));
  }
  if ((mm>1.0))
  {
    if (((model_.kBeta)>0.0))
    {
      if ((((model_.Bf)-((model_.kBeta)*Tex))>1e-6))
      {

        d_EdBeta_dV_bii_ci = (((((model_.kc)*(mm-1))+1)*(-(model_.kc)*d_mm_dV_bii_ci)-((1/((model_.Bf)-((model_.kBeta)*Tex)))-((model_.kc)*(mm-1)))*(model_.kc)*d_mm_dV_bii_ci)/(((model_.kc)*(mm-1))+1)/(((model_.kc)*(mm-1))+1));
        d_EdBeta_dV_ti_GND = ((-1*(-(model_.kBeta)*d_Tex_dV_ti_GND)/((model_.Bf)-((model_.kBeta)*Tex))/((model_.Bf)-((model_.kBeta)*Tex)))/(((model_.kc)*(mm-1))+1));
        EdBeta = (((1/((model_.Bf)-((model_.kBeta)*Tex)))-((model_.kc)*(mm-1)))/(((model_.kc)*(mm-1))+1));
      }
      else
      {

        d_EdBeta_dV_ti_GND =  0.0;
        d_EdBeta_dV_bii_ci = (((((model_.kc)*(mm-1))+1)*(-(model_.kc)*d_mm_dV_bii_ci)-(1e6-((model_.kc)*(mm-1)))*(model_.kc)*d_mm_dV_bii_ci)/(((model_.kc)*(mm-1))+1)/(((model_.kc)*(mm-1))+1));
        EdBeta = ((1e6-((model_.kc)*(mm-1)))/(((model_.kc)*(mm-1))+1));
      }
    }
    else
    {

      d_EdBeta_dV_ti_GND =  0.0;
      d_EdBeta_dV_bii_ci = (((((model_.kc)*(mm-1))+1)*(-(model_.kc)*d_mm_dV_bii_ci)-((1/(model_.Bf))-((model_.kc)*(mm-1)))*(model_.kc)*d_mm_dV_bii_ci)/(((model_.kc)*(mm-1))+1)/(((model_.kc)*(mm-1))+1));
      EdBeta = (((1/(model_.Bf))-((model_.kc)*(mm-1)))/(((model_.kc)*(mm-1))+1));
    }
  }
  else
  {
    if (((model_.kBeta)>0.0))
    {
      if ((((model_.Bf)-((model_.kBeta)*Tex))>1e-6))
      {

        d_EdBeta_dV_bii_ci =  0.0;
        d_EdBeta_dV_ti_GND = (-1*(-(model_.kBeta)*d_Tex_dV_ti_GND)/((model_.Bf)-((model_.kBeta)*Tex))/((model_.Bf)-((model_.kBeta)*Tex)));
        EdBeta = (1/((model_.Bf)-((model_.kBeta)*Tex)));
      }
      else
      {

        d_EdBeta_dV_ti_GND = d_EdBeta_dV_bii_ci =  0.0;
        EdBeta = 1e6;
      }
    }
    else
    {

      d_EdBeta_dV_ti_GND = d_EdBeta_dV_bii_ci =  0.0;
      EdBeta = (1/(model_.Bf));
    }
  }

  d_Ib0_dV_bii_ci = Ic0a*d_EdBeta_dV_bii_ci;
  d_Ib0_dV_ti_GND = (Ic0a*d_EdBeta_dV_ti_GND+d_Ic0a_dV_ti_GND*EdBeta);
  d_Ib0_dV_bii_ei = d_Ic0a_dV_bii_ei*EdBeta;
  Ib0 = (Ic0a*EdBeta);
  if (((model_.BVebo)>0))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(((-(model_.BVebo))-vbei),(model_.Jsf),0.0,1.0,Area,0.0,0.0);

      d_Ib1_dV_bii_ci = d_Ib0_dV_bii_ci;
      d_Ib1_dV_ti_GND = d_Ib0_dV_ti_GND;
      d_Ib1_dV_bii_ei = (d_Ib0_dV_bii_ei-evaluator_diode_0.getDerivs(((-(model_.BVebo))-vbei),(model_.Jsf),0.0,1.0,Area,0.0,0.0,(-d_vbei_dV_bii_ei),0.0,0.0,0.0,0.0,0.0,0.0));
      Ib1 = (Ib0-evaluator_diode_0.getValues(((-(model_.BVebo))-vbei),(model_.Jsf),0.0,1.0,Area,0.0,0.0));
    }
  }
  else
  {

    d_Ib1_dV_bii_ci = d_Ib0_dV_bii_ci;
    d_Ib1_dV_ti_GND = d_Ib0_dV_ti_GND;
    d_Ib1_dV_bii_ei = d_Ib0_dV_bii_ei;
    Ib1 = Ib0;
  }
  if ((((model_.Jse)>0.0)&&((model_.ne)>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxe,(model_.Jse),(model_.Vgb),(model_.ne),Area,Tj,(model_.Tnom));

      d_Ibdx_dV_ti_GND = evaluator_diode_0.getDerivs(vxe,(model_.Jse),(model_.Vgb),(model_.ne),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0);
      d_Ibdx_dV_ex_ei = evaluator_diode_0.getDerivs(vxe,(model_.Jse),(model_.Vgb),(model_.ne),Area,Tj,(model_.Tnom),d_vxe_dV_ex_ei,0.0,0.0,0.0,0.0,0.0,0.0);
      Ibdx = evaluator_diode_0.getValues(vxe,(model_.Jse),(model_.Vgb),(model_.ne),Area,Tj,(model_.Tnom));
    }
  }
  else
  {

    d_Ibdx_dV_ti_GND =  0.0;
    d_Ibdx_dV_ex_ei = d_vxe_dV_ex_ei*1e-12;
    Ibdx = (vxe*1e-12);
  }
  if ((((model_.Jsee)>0.0)&&((model_.nee)>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxxe,(model_.Jsee),(model_.Vgbb),(model_.nee),Area,Tj,(model_.Tnom));

      d_Ibdxx_dV_ti_GND = evaluator_diode_0.getDerivs(vxxe,(model_.Jsee),(model_.Vgbb),(model_.nee),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0);
      d_Ibdxx_dV_exx_ei = evaluator_diode_0.getDerivs(vxxe,(model_.Jsee),(model_.Vgbb),(model_.nee),Area,Tj,(model_.Tnom),d_vxxe_dV_exx_ei,0.0,0.0,0.0,0.0,0.0,0.0);
      Ibdxx = evaluator_diode_0.getValues(vxxe,(model_.Jsee),(model_.Vgbb),(model_.nee),Area,Tj,(model_.Tnom));
    }
  }
  else
  {

    d_Ibdxx_dV_ti_GND =  0.0;
    d_Ibdxx_dV_exx_ei = d_vxxe_dV_exx_ei*1e-12;
    Ibdxx = (vxxe*1e-12);
  }
  if ((((model_.Jsc)>0.0)&&((model_.nc)>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxc,(model_.Jsc),(model_.Vgc),(model_.nc),Area,Tj,(model_.Tnom));

      d_Icdx_dV_ti_GND = evaluator_diode_0.getDerivs(vxc,(model_.Jsc),(model_.Vgc),(model_.nc),Area,Tj,(model_.Tnom),0.0,0.0,0.0,0.0,0.0,d_Tj_dV_ti_GND,0.0);
      d_Icdx_dV_cx_ci = evaluator_diode_0.getDerivs(vxc,(model_.Jsc),(model_.Vgc),(model_.nc),Area,Tj,(model_.Tnom),d_vxc_dV_cx_ci,0.0,0.0,0.0,0.0,0.0,0.0);
      Icdx = evaluator_diode_0.getValues(vxc,(model_.Jsc),(model_.Vgc),(model_.nc),Area,Tj,(model_.Tnom));
    }
  }
  else
  {

    d_Icdx_dV_ti_GND =  0.0;
    d_Icdx_dV_cx_ci = d_vxc_dV_cx_ci*1e-12;
    Icdx = (vxc*1e-12);
  }

  d_Ipdiss_dV_bi_ci = (Ibx*d_vbcx_dV_bi_ci+d_Ibx_dV_bi_ci*vbcx);
  d_Ipdiss_dV_ci_ei = Ic1*d_vcei_dV_ci_ei;
  d_Ipdiss_dV_bii_ci = ((d_Ic1_dV_bii_ci*vcei+d_Ib1_dV_bii_ci*vbei)+(Ib2*d_vbci_dV_bii_ci+d_Ib2_dV_bii_ci*vbci));
  d_Ipdiss_dV_ti_GND = (((d_Ic1_dV_ti_GND*vcei+d_Ib1_dV_ti_GND*vbei)+d_Ib2_dV_ti_GND*vbci)+d_Ibx_dV_ti_GND*vbcx);
  d_Ipdiss_dV_bii_ei = (d_Ic1_dV_bii_ei*vcei+(Ib1*d_vbei_dV_bii_ei+d_Ib1_dV_bii_ei*vbei));
  Ipdiss = ((((Ic1*vcei)+(Ib1*vbei))+(Ib2*vbci))+(Ibx*vbcx));
  if ((Ipdiss<0.0))
  {

    d_Ipdiss_dV_bii_ei = d_Ipdiss_dV_ti_GND = d_Ipdiss_dV_bii_ci = d_Ipdiss_dV_ci_ei = d_Ipdiss_dV_bi_ci =  0.0;
    Ipdiss = 0;
  }
  I00 = ((model_.J0)*Area);
  if ((((model_.XCjc)<1.0)&&((model_.XCjc)>0.0)))
  {
    if ((((model_.J0)<=0.0)||(Ic0<0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area);

        d_qb2med_dV_bii_ei = d_qb2med_dV_ti_GND =  0.0;
        d_qb2med_dV_bii_ci = ((model_.XCjc)*evaluator_charge_0.getDerivs(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)+(((model_.XCjc)*Area)*(model_.Cmin))*d_vbci_dV_bii_ci);
        qb2med = (((model_.XCjc)*evaluator_charge_0.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area))+((((model_.XCjc)*Area)*(model_.Cmin))*vbci));
      }
    }
    else
    {

      d_xix_dV_bii_ci = (d_Ic0_dV_bii_ci/I00);
      d_xix_dV_ti_GND = (d_Ic0_dV_ti_GND/I00);
      d_xix_dV_bii_ei = (d_Ic0_dV_bii_ei/I00);
      xix = (Ic0/I00);
      {
        double value_tanh_0 = tanh(xix);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area);
        double  deriv_tanh_0_d0 = (1.0/cosh(xix)/cosh(xix));

        d_qb2med_dV_bii_ci = ((((model_.XCjc)*(1.0-value_tanh_0))*(evaluator_charge_1.getDerivs(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)+(((1.0-(model_.XJ0))*Area)*(model_.Cmin))*d_vbci_dV_bii_ci)+(model_.XCjc)*(-(deriv_tanh_0_d0*(d_xix_dV_bii_ci)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci)))+((((model_.XJ0)*(model_.XCjc))*Area)*(model_.Cmin))*d_vbci_dV_bii_ci);
        d_qb2med_dV_ti_GND = (model_.XCjc)*(-(deriv_tanh_0_d0*(d_xix_dV_ti_GND)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci));
        d_qb2med_dV_bii_ei = (model_.XCjc)*(-(deriv_tanh_0_d0*(d_xix_dV_bii_ei)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci));
        qb2med = ((((model_.XCjc)*(1.0-value_tanh_0))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci)))+(((((model_.XJ0)*(model_.XCjc))*Area)*(model_.Cmin))*vbci));
      }
    }
  }
  else
  {
    if ((((model_.J0)<0.0)||(Ic0<0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area);

        d_qb2med_dV_bii_ei = d_qb2med_dV_ti_GND =  0.0;
        d_qb2med_dV_bii_ci = (evaluator_charge_0.getDerivs(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)+(Area*(model_.Cmin))*d_vbci_dV_bii_ci);
        qb2med = (evaluator_charge_0.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((Area*(model_.Cmin))*vbci));
      }
    }
    else
    {

      d_xix_dV_bii_ci = (d_Ic0_dV_bii_ci/I00);
      d_xix_dV_ti_GND = (d_Ic0_dV_ti_GND/I00);
      d_xix_dV_bii_ei = (d_Ic0_dV_bii_ei/I00);
      xix = (Ic0/I00);
      {
        double value_tanh_0 = tanh(xix);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area);
        double  deriv_tanh_0_d0 = (1.0/cosh(xix)/cosh(xix));

        d_qb2med_dV_bii_ci = (((1.0-value_tanh_0)*(evaluator_charge_1.getDerivs(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area,d_vbci_dV_bii_ci,0.0,0.0,0.0,0.0)+(((1.0-(model_.XJ0))*Area)*(model_.Cmin))*d_vbci_dV_bii_ci)+(-(deriv_tanh_0_d0*(d_xix_dV_bii_ci)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci)))+(((model_.XJ0)*Area)*(model_.Cmin))*d_vbci_dV_bii_ci);
        d_qb2med_dV_ti_GND = (-(deriv_tanh_0_d0*(d_xix_dV_ti_GND)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci));
        d_qb2med_dV_bii_ei = (-(deriv_tanh_0_d0*(d_xix_dV_bii_ei)))*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci));
        qb2med = (((1.0-value_tanh_0)*(evaluator_charge_1.getValues(vbci,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area)+((((1.0-(model_.XJ0))*Area)*(model_.Cmin))*vbci)))+((((model_.XJ0)*Area)*(model_.Cmin))*vbci));
      }
    }
  }
  if ((((model_.XCjc)<1.0)&&((model_.XCjc)>0.0)))
  {
    {
      AnalogFunctions::chargeEvaluator evaluator_charge_0(vbcx,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area);

      d_qb1_dV_bi_ci = ((1.0-(model_.XCjc))*evaluator_charge_0.getDerivs(vbcx,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area,d_vbcx_dV_bi_ci,0.0,0.0,0.0,0.0)+(((1.0-(model_.XCjc))*Area)*(model_.Cmin))*d_vbcx_dV_bi_ci);
      qb1 = (((1.0-(model_.XCjc))*evaluator_charge_0.getValues(vbcx,((model_.Cjc)-(model_.Cmin)),(model_.Vjc),(model_.mjc),Area))+((((1.0-(model_.XCjc))*Area)*(model_.Cmin))*vbcx));
    }
  }
  else
  {

    d_qb1_dV_bi_ci =  0.0;
    qb1 = 0.0;
  }

  d_qbtr_dV_bii_ei = (model_.Tr)*d_Ic1r_dV_bii_ei;
  d_qbtr_dV_ti_GND = (model_.Tr)*d_Ic1r_dV_ti_GND;
  d_qbtr_dV_bii_ci = (model_.Tr)*d_Ic1r_dV_bii_ci;
  qbtr = ((model_.Tr)*Ic1r);

  d_qbtra_dV_ti_GND = (model_.Trx)*d_Ibx_dV_ti_GND;
  d_qbtra_dV_bi_ci = (model_.Trx)*d_Ibx_dV_bi_ci;
  qbtra = ((model_.Trx)*Ibx);

  d_qb2_dV_bii_ci = (d_qb2med_dV_bii_ci+d_qbtr_dV_bii_ci);
  d_qb2_dV_ti_GND = (d_qb2med_dV_ti_GND+d_qbtr_dV_ti_GND);
  d_qb2_dV_bii_ei = (d_qb2med_dV_bii_ei+d_qbtr_dV_bii_ei);
  qb2 = (qb2med+qbtr);
  if ((((model_.Jk)>0.0)&&((model_.Rci0)>0.0)))
  {
    if (((model_.RJk)>0.0))
    {
      Vlim = (((model_.Jk)*(model_.Rci0))/(1.0-((model_.Rci0)/(model_.RJk))));
      InvVpt = ((1.0-((model_.Rci0)/(model_.RJk)))/((model_.Jk)*(model_.RJk)));
    }
    else
    {
      Vlim = (((model_.Jk)*(model_.Rci0))/1.016);
      InvVpt = 0.0;
    }
  }
  if ((((((model_.Thcs)>0.0)&&((model_.Ahc)>0.0))&&((model_.Jk)>0.0))&&(Ic0>0.0)))
  {
    RCIO = ((model_.Rci0)/Area);
    AHC = (Area*(model_.Ahc));
    if ((((model_.Rci0)<(model_.RJk))||((model_.RJk)<=0.0)))
    {
      {
        AnalogFunctions::ICKEvaluator evaluator_ICK_0(vcei,RCIO,Vlim,InvVpt,(model_.Vces));

        d_Ih_dV_bii_ci = (-(-evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,(model_.Vces))*d_Ic0_dV_bii_ci/Ic0/Ic0));
        d_Ih_dV_ti_GND = (-(-evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,(model_.Vces))*d_Ic0_dV_ti_GND/Ic0/Ic0));
        d_Ih_dV_bii_ei = (-(-evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,(model_.Vces))*d_Ic0_dV_bii_ei/Ic0/Ic0));
        d_Ih_dV_ci_ei = (-(evaluator_ICK_0.getDerivs(vcei,RCIO,Vlim,InvVpt,(model_.Vces),d_vcei_dV_ci_ei,0.0,0.0,0.0,0.0)/Ic0));
        Ih = (1.0-(evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,(model_.Vces))/Ic0));
      }
    }
    else
    {
      {
        AnalogFunctions::VceffEvaluator evaluator_Vceff_0(vcei,(model_.Vces));

        d_Ih_dV_bii_ci = (-(-evaluator_Vceff_0.getValues(vcei,(model_.Vces))*RCIO*d_Ic0_dV_bii_ci/(RCIO*Ic0)/(RCIO*Ic0)));
        d_Ih_dV_ti_GND = (-(-evaluator_Vceff_0.getValues(vcei,(model_.Vces))*RCIO*d_Ic0_dV_ti_GND/(RCIO*Ic0)/(RCIO*Ic0)));
        d_Ih_dV_bii_ei = (-(-evaluator_Vceff_0.getValues(vcei,(model_.Vces))*RCIO*d_Ic0_dV_bii_ei/(RCIO*Ic0)/(RCIO*Ic0)));
        d_Ih_dV_ci_ei = (-(evaluator_Vceff_0.getDerivs(vcei,(model_.Vces),d_vcei_dV_ci_ei,0.0)/(RCIO*Ic0)));
        Ih = (1.0-(evaluator_Vceff_0.getValues(vcei,(model_.Vces))/(RCIO*Ic0)));
      }
    }
    {
      double value_sqrt_0 = sqrt(((Ih*Ih)+AHC));
      double value_sqrt_1 = sqrt((1.0+AHC));
      double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
      double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);

      d_Wh_dV_bii_ci = ((d_Ih_dV_bii_ci+(deriv_sqrt_0_d0*((Ih*d_Ih_dV_bii_ci+d_Ih_dV_bii_ci*Ih))))/(1.0+value_sqrt_1));
      d_Wh_dV_ti_GND = ((d_Ih_dV_ti_GND+(deriv_sqrt_0_d0*((Ih*d_Ih_dV_ti_GND+d_Ih_dV_ti_GND*Ih))))/(1.0+value_sqrt_1));
      d_Wh_dV_bii_ei = ((d_Ih_dV_bii_ei+(deriv_sqrt_0_d0*((Ih*d_Ih_dV_bii_ei+d_Ih_dV_bii_ei*Ih))))/(1.0+value_sqrt_1));
      d_Wh_dV_ci_ei = ((d_Ih_dV_ci_ei+(deriv_sqrt_0_d0*((Ih*d_Ih_dV_ci_ei+d_Ih_dV_ci_ei*Ih))))/(1.0+value_sqrt_1));
      Wh = ((Ih+value_sqrt_0)/(1.0+value_sqrt_1));
    }

    d_xtff_dV_ci_ei = ((model_.Thcs)*Ic0)*(Wh*d_Wh_dV_ci_ei+d_Wh_dV_ci_ei*Wh);
    d_xtff_dV_bii_ci = (((model_.Thcs)*Ic0)*(Wh*d_Wh_dV_bii_ci+d_Wh_dV_bii_ci*Wh)+(model_.Thcs)*d_Ic0_dV_bii_ci*(Wh*Wh));
    d_xtff_dV_ti_GND = (((model_.Thcs)*Ic0)*(Wh*d_Wh_dV_ti_GND+d_Wh_dV_ti_GND*Wh)+(model_.Thcs)*d_Ic0_dV_ti_GND*(Wh*Wh));
    d_xtff_dV_bii_ei = (((model_.Thcs)*Ic0)*(Wh*d_Wh_dV_bii_ei+d_Wh_dV_bii_ei*Wh)+(model_.Thcs)*d_Ic0_dV_bii_ei*(Wh*Wh));
    xtff = (((model_.Thcs)*Ic0)*(Wh*Wh));
  }
  else
  {

    d_xtff_dV_bii_ei = d_xtff_dV_ti_GND = d_xtff_dV_bii_ci = d_xtff_dV_ci_ei =  0.0;
    xtff = 0;
  }

  d_qbtf_dV_bii_ci = ((model_.Tf)+((model_.Tft)*Tex))*d_Ic0_dV_bii_ci;
  d_qbtf_dV_bii_ei = ((model_.Tf)+((model_.Tft)*Tex))*d_Ic0_dV_bii_ei;
  d_qbtf_dV_ti_GND = (((model_.Tf)+((model_.Tft)*Tex))*d_Ic0_dV_ti_GND+(model_.Tft)*d_Tex_dV_ti_GND*Ic0);
  qbtf = (((model_.Tf)+((model_.Tft)*Tex))*Ic0);
  {
    AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,(model_.Cje),(model_.Vje),(model_.mje),Area);

    d_qbe_dV_ci_ei = d_xtff_dV_ci_ei;
    d_qbe_dV_bii_ci = (d_xtff_dV_bii_ci+d_qbtf_dV_bii_ci);
    d_qbe_dV_ti_GND = (d_xtff_dV_ti_GND+d_qbtf_dV_ti_GND);
    d_qbe_dV_bii_ei = ((d_xtff_dV_bii_ei+d_qbtf_dV_bii_ei)+evaluator_charge_0.getDerivs(vbei,(model_.Cje),(model_.Vje),(model_.mje),Area,d_vbei_dV_bii_ei,0.0,0.0,0.0,0.0));
    qbe = ((xtff+qbtf)+evaluator_charge_0.getValues(vbei,(model_.Cje),(model_.Vje),(model_.mje),Area));
  }
  // I(bi,ci) <+ ((dtype*Ibx))
  {
    double contribTemp;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bi_ci;
    contribTemp= ((model_.dtype)*Ibx);
    d_contribTemp_dV_ti_GND = (model_.dtype)*d_Ibx_dV_ti_GND;
    d_contribTemp_dV_bi_ci = (model_.dtype)*d_Ibx_dV_bi_ci;
    staticContributions[admsNodeID_bi] += contribTemp;
    d_staticContributions[admsNodeID_bi][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += d_contribTemp_dV_bi_ci;
    staticContributions[admsNodeID_ci] -= contribTemp;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= d_contribTemp_dV_bi_ci;

    Jdxp_static[admsNodeID_bi] += d_contribTemp_dV_bi_ci*probeDiffs[admsProbeID_V_bi_ci]*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
    Jdxp_static[admsNodeID_ci] -= d_contribTemp_dV_bi_ci*probeDiffs[admsProbeID_V_bi_ci]*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
  }
  // I(bi,ci) <+ ((dtype*ddt((qb1+qbtra))))
  {
    double contribTemp;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bi_ci;
    contribTemp= ((model_.dtype)*((qb1+qbtra)));
    d_contribTemp_dV_ti_GND = (model_.dtype)*(d_qbtra_dV_ti_GND);
    d_contribTemp_dV_bi_ci = (model_.dtype)*((d_qb1_dV_bi_ci+d_qbtra_dV_bi_ci));
    dynamicContributions[admsNodeID_bi] += contribTemp;
    d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] += d_contribTemp_dV_bi_ci;
    dynamicContributions[admsNodeID_ci] -= contribTemp;
    d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] -= d_contribTemp_dV_bi_ci;

    Jdxp_dynamic[admsNodeID_bi] += d_contribTemp_dV_bi_ci*probeDiffs[admsProbeID_V_bi_ci]*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
    Jdxp_dynamic[admsNodeID_ci] -= d_contribTemp_dV_bi_ci*probeDiffs[admsProbeID_V_bi_ci]*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci];
  }
  // I(bii,ci) <+ ((dtype*Ib2))
  {
    double contribTemp;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ci;
    contribTemp= ((model_.dtype)*Ib2);
    d_contribTemp_dV_ti_GND = (model_.dtype)*d_Ib2_dV_ti_GND;
    d_contribTemp_dV_bii_ci = (model_.dtype)*d_Ib2_dV_bii_ci;
    staticContributions[admsNodeID_bii] += contribTemp;
    d_staticContributions[admsNodeID_bii][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    staticContributions[admsNodeID_ci] -= contribTemp;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -= d_contribTemp_dV_bii_ci;

    Jdxp_static[admsNodeID_bii] += d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci];
    Jdxp_static[admsNodeID_ci] -= d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci];
  }
  // I(bii,ci) <+ ((dtype*ddt(qb2)))
  {
    double contribTemp;
    double d_contribTemp_dV_bii_ci;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ei;
    contribTemp= ((model_.dtype)*(qb2));
    d_contribTemp_dV_bii_ci = (model_.dtype)*(d_qb2_dV_bii_ci);
    d_contribTemp_dV_ti_GND = (model_.dtype)*(d_qb2_dV_ti_GND);
    d_contribTemp_dV_bii_ei = (model_.dtype)*(d_qb2_dV_bii_ei);
    dynamicContributions[admsNodeID_bii] += contribTemp;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei] += d_contribTemp_dV_bii_ei;
    dynamicContributions[admsNodeID_ci] -= contribTemp;
    d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -= d_contribTemp_dV_bii_ci;
    d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei] -= d_contribTemp_dV_bii_ei;

    Jdxp_dynamic[admsNodeID_bii] += d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
    Jdxp_dynamic[admsNodeID_ci] -= d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
  }
  // I(bii,ei) <+ ((dtype*Ib1))
  {
    double contribTemp;
    double d_contribTemp_dV_bii_ci;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ei;
    contribTemp= ((model_.dtype)*Ib1);
    d_contribTemp_dV_bii_ci = (model_.dtype)*d_Ib1_dV_bii_ci;
    d_contribTemp_dV_ti_GND = (model_.dtype)*d_Ib1_dV_ti_GND;
    d_contribTemp_dV_bii_ei = (model_.dtype)*d_Ib1_dV_bii_ei;
    staticContributions[admsNodeID_bii] += contribTemp;
    d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    d_staticContributions[admsNodeID_bii][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei] += d_contribTemp_dV_bii_ei;
    staticContributions[admsNodeID_ei] -= contribTemp;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci] -= d_contribTemp_dV_bii_ci;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei] -= d_contribTemp_dV_bii_ei;

    Jdxp_static[admsNodeID_bii] += d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
    Jdxp_static[admsNodeID_ei] -= d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
  }
  // I(bii,ei) <+ ((dtype*ddt(qbe)))
  {
    double contribTemp;
    double d_contribTemp_dV_ci_ei;
    double d_contribTemp_dV_bii_ci;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ei;
    contribTemp= ((model_.dtype)*(qbe));
    d_contribTemp_dV_ci_ei = (model_.dtype)*(d_qbe_dV_ci_ei);
    d_contribTemp_dV_bii_ci = (model_.dtype)*(d_qbe_dV_bii_ci);
    d_contribTemp_dV_ti_GND = (model_.dtype)*(d_qbe_dV_ti_GND);
    d_contribTemp_dV_bii_ei = (model_.dtype)*(d_qbe_dV_bii_ei);
    dynamicContributions[admsNodeID_bii] += contribTemp;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] += d_contribTemp_dV_ci_ei;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei] += d_contribTemp_dV_bii_ei;
    dynamicContributions[admsNodeID_ei] -= contribTemp;
    d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] -= d_contribTemp_dV_ci_ei;
    d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci] -= d_contribTemp_dV_bii_ci;
    d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] -= d_contribTemp_dV_bii_ei;

    Jdxp_dynamic[admsNodeID_bii] += d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
    Jdxp_dynamic[admsNodeID_ei] -= d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
  }
  // I(ci,ei) <+ ((dtype*Ic1))
  {
    double contribTemp;
    double d_contribTemp_dV_bii_ci;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ei;
    contribTemp= ((model_.dtype)*Ic1);
    d_contribTemp_dV_bii_ci = (model_.dtype)*d_Ic1_dV_bii_ci;
    d_contribTemp_dV_ti_GND = (model_.dtype)*d_Ic1_dV_ti_GND;
    d_contribTemp_dV_bii_ei = (model_.dtype)*d_Ic1_dV_bii_ei;
    staticContributions[admsNodeID_ci] += contribTemp;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei] += d_contribTemp_dV_bii_ei;
    staticContributions[admsNodeID_ei] -= contribTemp;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci] -= d_contribTemp_dV_bii_ci;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND] -= d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei] -= d_contribTemp_dV_bii_ei;

    Jdxp_static[admsNodeID_ci] += d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
    Jdxp_static[admsNodeID_ei] -= d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
  }
  // I(ex,ei) <+ ((dtype*Ibdx))
  staticContributions[admsNodeID_ex] += ((model_.dtype)*Ibdx);
  d_staticContributions[admsNodeID_ex][admsProbeID_V_ti_GND] += (model_.dtype)*d_Ibdx_dV_ti_GND;
  d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei] += (model_.dtype)*d_Ibdx_dV_ex_ei;
  staticContributions[admsNodeID_ei] -= ((model_.dtype)*Ibdx);
  d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND] -= (model_.dtype)*d_Ibdx_dV_ti_GND;
  d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei] -= (model_.dtype)*d_Ibdx_dV_ex_ei;
  // I(exx,ei) <+ ((dtype*Ibdxx))
  staticContributions[admsNodeID_exx] += ((model_.dtype)*Ibdxx);
  d_staticContributions[admsNodeID_exx][admsProbeID_V_ti_GND] += (model_.dtype)*d_Ibdxx_dV_ti_GND;
  d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei] += (model_.dtype)*d_Ibdxx_dV_exx_ei;
  staticContributions[admsNodeID_ei] -= ((model_.dtype)*Ibdxx);
  d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND] -= (model_.dtype)*d_Ibdxx_dV_ti_GND;
  d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei] -= (model_.dtype)*d_Ibdxx_dV_exx_ei;
  // I(cx,ci) <+ ((dtype*Icdx))
  staticContributions[admsNodeID_cx] += ((model_.dtype)*Icdx);
  d_staticContributions[admsNodeID_cx][admsProbeID_V_ti_GND] += (model_.dtype)*d_Icdx_dV_ti_GND;
  d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci] += (model_.dtype)*d_Icdx_dV_cx_ci;
  staticContributions[admsNodeID_ci] -= ((model_.dtype)*Icdx);
  d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND] -= (model_.dtype)*d_Icdx_dV_ti_GND;
  d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci] -= (model_.dtype)*d_Icdx_dV_cx_ci;
  // V(b,bi) <+ ((I(b,bi)*(Rb/N)))
  d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi] += d_probeVars[admsProbeID_I_b_bi][admsProbeID_I_b_bi]*((model_.Rb)/N);
  staticContributions[admsBRA_ID_b_bi] += ((probeVars[admsProbeID_I_b_bi])*((model_.Rb)/N));
  // V(b,bi) <+ (ddt((I(b,bi)*Lb)))
  d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi] += (d_probeVars[admsProbeID_I_b_bi][admsProbeID_I_b_bi]*(model_.Lb));
  dynamicContributions[admsBRA_ID_b_bi] += (((probeVars[admsProbeID_I_b_bi])*(model_.Lb)));
  // V(e,ei) <+ ((I(e,ei)*(Re/N)))
  d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei] += d_probeVars[admsProbeID_I_e_ei][admsProbeID_I_e_ei]*((model_.Re)/N);
  staticContributions[admsBRA_ID_e_ei] += ((probeVars[admsProbeID_I_e_ei])*((model_.Re)/N));
  // V(e,ei) <+ (ddt((I(e,ei)*Le)))
  d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei] += (d_probeVars[admsProbeID_I_e_ei][admsProbeID_I_e_ei]*(model_.Le));
  dynamicContributions[admsBRA_ID_e_ei] += (((probeVars[admsProbeID_I_e_ei])*(model_.Le)));
  // V(c,ci) <+ ((I(c,ci)*(Rc/N)))
  d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci] += d_probeVars[admsProbeID_I_c_ci][admsProbeID_I_c_ci]*((model_.Rc)/N);
  staticContributions[admsBRA_ID_c_ci] += ((probeVars[admsProbeID_I_c_ci])*((model_.Rc)/N));
  // V(c,ci) <+ (ddt((I(c,ci)*Lc)))
  d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci] += (d_probeVars[admsProbeID_I_c_ci][admsProbeID_I_c_ci]*(model_.Lc));
  dynamicContributions[admsBRA_ID_c_ci] += (((probeVars[admsProbeID_I_c_ci])*(model_.Lc)));
  // I(bii,bi) <+ ((V(bii,bi)/(Rb2/N)))
  staticContributions[admsNodeID_bii] += ((probeVars[admsProbeID_V_bii_bi])/((model_.Rb2)/N));
  d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi] += (d_probeVars[admsProbeID_V_bii_bi][admsProbeID_V_bii_bi]/((model_.Rb2)/N));
  staticContributions[admsNodeID_bi] -= ((probeVars[admsProbeID_V_bii_bi])/((model_.Rb2)/N));
  d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi] -= (d_probeVars[admsProbeID_V_bii_bi][admsProbeID_V_bii_bi]/((model_.Rb2)/N));
  if ((((model_.Jse)>0.0)&&((model_.ne)>0)))
  {
    // I(ex,bii) <+ ((V(ex,bii)/(Rbxx/N)))
    staticContributions[admsNodeID_ex] += ((probeVars[admsProbeID_V_ex_bii])/((model_.Rbxx)/N));
    d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii] += (d_probeVars[admsProbeID_V_ex_bii][admsProbeID_V_ex_bii]/((model_.Rbxx)/N));
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_ex_bii])/((model_.Rbxx)/N));
    d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii] -= (d_probeVars[admsProbeID_V_ex_bii][admsProbeID_V_ex_bii]/((model_.Rbxx)/N));
  }
  else
  {
    // I(ex,bii) <+ ((V(ex,bii)*1e-12))
    staticContributions[admsNodeID_ex] += ((probeVars[admsProbeID_V_ex_bii])*1e-12);
    d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii] += d_probeVars[admsProbeID_V_ex_bii][admsProbeID_V_ex_bii]*1e-12;
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_ex_bii])*1e-12);
    d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii] -= d_probeVars[admsProbeID_V_ex_bii][admsProbeID_V_ex_bii]*1e-12;
  }
  if ((((model_.Jsee)>0.0)&&((model_.nee)>0)))
  {
    // I(exx,bii) <+ ((V(exx,bii)/(Rbbxx/N)))
    staticContributions[admsNodeID_exx] += ((probeVars[admsProbeID_V_exx_bii])/((model_.Rbbxx)/N));
    d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii] += (d_probeVars[admsProbeID_V_exx_bii][admsProbeID_V_exx_bii]/((model_.Rbbxx)/N));
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_exx_bii])/((model_.Rbbxx)/N));
    d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii] -= (d_probeVars[admsProbeID_V_exx_bii][admsProbeID_V_exx_bii]/((model_.Rbbxx)/N));
  }
  else
  {
    // I(exx,bii) <+ ((V(exx,bii)*1e-12))
    staticContributions[admsNodeID_exx] += ((probeVars[admsProbeID_V_exx_bii])*1e-12);
    d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii] += d_probeVars[admsProbeID_V_exx_bii][admsProbeID_V_exx_bii]*1e-12;
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_exx_bii])*1e-12);
    d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii] -= d_probeVars[admsProbeID_V_exx_bii][admsProbeID_V_exx_bii]*1e-12;
  }
  if ((((model_.Jsc)>0.0)&&((model_.nc)>0)))
  {
    // I(cx,bii) <+ ((V(cx,bii)/(Rcxx/N)))
    staticContributions[admsNodeID_cx] += ((probeVars[admsProbeID_V_cx_bii])/((model_.Rcxx)/N));
    d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii] += (d_probeVars[admsProbeID_V_cx_bii][admsProbeID_V_cx_bii]/((model_.Rcxx)/N));
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_cx_bii])/((model_.Rcxx)/N));
    d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii] -= (d_probeVars[admsProbeID_V_cx_bii][admsProbeID_V_cx_bii]/((model_.Rcxx)/N));
  }
  else
  {
    // I(cx,bii) <+ ((V(cx,bii)*1e-12))
    staticContributions[admsNodeID_cx] += ((probeVars[admsProbeID_V_cx_bii])*1e-12);
    d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii] += d_probeVars[admsProbeID_V_cx_bii][admsProbeID_V_cx_bii]*1e-12;
    staticContributions[admsNodeID_bii] -= ((probeVars[admsProbeID_V_cx_bii])*1e-12);
    d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii] -= d_probeVars[admsProbeID_V_cx_bii][admsProbeID_V_cx_bii]*1e-12;
  }
  // I(b,GND) <+ (ddt((Cpb*V(b,GND))))
  dynamicContributions[admsNodeID_b] += (((model_.Cpb)*(probeVars[admsProbeID_V_b_GND])));
  d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_GND] += ((model_.Cpb)*d_probeVars[admsProbeID_V_b_GND][admsProbeID_V_b_GND]);
  // I(c,GND) <+ (ddt((Cpc*V(c,GND))))
  dynamicContributions[admsNodeID_c] += (((model_.Cpc)*(probeVars[admsProbeID_V_c_GND])));
  d_dynamicContributions[admsNodeID_c][admsProbeID_V_c_GND] += ((model_.Cpc)*d_probeVars[admsProbeID_V_c_GND][admsProbeID_V_c_GND]);
  // I(b,c) <+ (ddt((Cq*V(b,c))))
  dynamicContributions[admsNodeID_b] += (((model_.Cq)*(probeVars[admsProbeID_V_b_c])));
  d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c] += ((model_.Cq)*d_probeVars[admsProbeID_V_b_c][admsProbeID_V_b_c]);
  dynamicContributions[admsNodeID_c] -= (((model_.Cq)*(probeVars[admsProbeID_V_b_c])));
  d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c] -= ((model_.Cq)*d_probeVars[admsProbeID_V_b_c][admsProbeID_V_b_c]);
  // I(ti,GND) <+ ((-Ipdiss))
  {
    double contribTemp;
    double d_contribTemp_dV_bi_ci;
    double d_contribTemp_dV_ci_ei;
    double d_contribTemp_dV_bii_ci;
    double d_contribTemp_dV_ti_GND;
    double d_contribTemp_dV_bii_ei;
    contribTemp= (-Ipdiss);
    d_contribTemp_dV_bi_ci = (-d_Ipdiss_dV_bi_ci);
    d_contribTemp_dV_ci_ei = (-d_Ipdiss_dV_ci_ei);
    d_contribTemp_dV_bii_ci = (-d_Ipdiss_dV_bii_ci);
    d_contribTemp_dV_ti_GND = (-d_Ipdiss_dV_ti_GND);
    d_contribTemp_dV_bii_ei = (-d_Ipdiss_dV_bii_ei);
    staticContributions[admsNodeID_ti] += contribTemp;
    d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci] += d_contribTemp_dV_bi_ci;
    d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei] += d_contribTemp_dV_ci_ei;
    d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci] += d_contribTemp_dV_bii_ci;
    d_staticContributions[admsNodeID_ti][admsProbeID_V_ti_GND] += d_contribTemp_dV_ti_GND;
    d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] += d_contribTemp_dV_bii_ei;

    Jdxp_static[admsNodeID_ti] += d_contribTemp_dV_bi_ci*probeDiffs[admsProbeID_V_bi_ci]*d_probeVars[admsProbeID_V_bi_ci][admsProbeID_V_bi_ci]+d_contribTemp_dV_bii_ci*probeDiffs[admsProbeID_V_bii_ci]*d_probeVars[admsProbeID_V_bii_ci][admsProbeID_V_bii_ci]+d_contribTemp_dV_bii_ei*probeDiffs[admsProbeID_V_bii_ei]*d_probeVars[admsProbeID_V_bii_ei][admsProbeID_V_bii_ei];
  }
  if (((model_.Rth)>0))
  {
    // I(t,ti) <+ ((V(t,ti)/Rth))
    staticContributions[admsNodeID_t] += ((probeVars[admsProbeID_V_t_ti])/(model_.Rth));
    d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti] += (d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]/(model_.Rth));
    staticContributions[admsNodeID_ti] -= ((probeVars[admsProbeID_V_t_ti])/(model_.Rth));
    d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti] -= (d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]/(model_.Rth));
    // I(t,ti) <+ ((Cth*ddt(V(t,ti))))
    dynamicContributions[admsNodeID_t] += ((model_.Cth)*((probeVars[admsProbeID_V_t_ti])));
    d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti] += (model_.Cth)*(d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]);
    dynamicContributions[admsNodeID_ti] -= ((model_.Cth)*((probeVars[admsProbeID_V_t_ti])));
    d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti] -= (model_.Cth)*(d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]);
  }
  else
  {
    // I(t,ti) <+ ((V(t,ti)*1e3))
    staticContributions[admsNodeID_t] += ((probeVars[admsProbeID_V_t_ti])*1e3);
    d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti] += d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]*1e3;
    staticContributions[admsNodeID_ti] -= ((probeVars[admsProbeID_V_t_ti])*1e3);
    d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti] -= d_probeVars[admsProbeID_V_t_ti][admsProbeID_V_t_ti]*1e3;
  }

  // Additional term resulting from contributions into V(b,bi)
  staticContributions[admsNodeID_b] += probeVars[admsProbeID_I_b_bi];
  d_staticContributions[admsNodeID_b][admsProbeID_I_b_bi] += d_probeVars[admsProbeID_I_b_bi][admsProbeID_I_b_bi];
  staticContributions[admsNodeID_bi] -= probeVars[admsProbeID_I_b_bi];
  d_staticContributions[admsNodeID_bi][admsProbeID_I_b_bi] -= d_probeVars[admsProbeID_I_b_bi][admsProbeID_I_b_bi];

  // Additional term resulting from contributions into V(e,ei)
  staticContributions[admsNodeID_e] += probeVars[admsProbeID_I_e_ei];
  d_staticContributions[admsNodeID_e][admsProbeID_I_e_ei] += d_probeVars[admsProbeID_I_e_ei][admsProbeID_I_e_ei];
  staticContributions[admsNodeID_ei] -= probeVars[admsProbeID_I_e_ei];
  d_staticContributions[admsNodeID_ei][admsProbeID_I_e_ei] -= d_probeVars[admsProbeID_I_e_ei][admsProbeID_I_e_ei];

  // Additional term resulting from contributions into V(c,ci)
  staticContributions[admsNodeID_c] += probeVars[admsProbeID_I_c_ci];
  d_staticContributions[admsNodeID_c][admsProbeID_I_c_ci] += d_probeVars[admsProbeID_I_c_ci][admsProbeID_I_c_ci];
  staticContributions[admsNodeID_ci] -= probeVars[admsProbeID_I_c_ci];
  d_staticContributions[admsNodeID_ci][admsProbeID_I_c_ci] -= d_probeVars[admsProbeID_I_c_ci][admsProbeID_I_c_ci];
  // Final term for branch equation admsBRA_ID_b_bi 
  // Derivative of this term with respect to node is +/-1
  // Handling of that derivative is done explicitly in the loadDAEdFdX method
  staticContributions[admsBRA_ID_b_bi] -= (*solVectorPtr)[li_b]-(*solVectorPtr)[li_bi];
  // Final term for branch equation admsBRA_ID_e_ei 
  // Derivative of this term with respect to node is +/-1
  // Handling of that derivative is done explicitly in the loadDAEdFdX method
  staticContributions[admsBRA_ID_e_ei] -= (*solVectorPtr)[li_e]-(*solVectorPtr)[li_ei];
  // Final term for branch equation admsBRA_ID_c_ci 
  // Derivative of this term with respect to node is +/-1
  // Handling of that derivative is done explicitly in the loadDAEdFdX method
  staticContributions[admsBRA_ID_c_ci] -= (*solVectorPtr)[li_c]-(*solVectorPtr)[li_ci];


  // -- endcode converted from analog/code block
  if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS) && getSolverState().debugTimeFlag)
  {
    Xyce::dout() << " probeVars[admsProbeID_V_t_ti] =  "
                 <<probeVars[admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_c] =  "
                 <<probeVars[admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_c_GND] =  "
                 <<probeVars[admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_b_GND] =  "
                 <<probeVars[admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_cx_bii] =  "
                 <<probeVars[admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_exx_bii] =  "
                 <<probeVars[admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ex_bii] =  "
                 <<probeVars[admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bii_bi] =  "
                 <<probeVars[admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_I_c_ci] =  "
                 <<probeVars[admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_I_e_ei] =  "
                 <<probeVars[admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_I_b_bi] =  "
                 <<probeVars[admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ti_GND] =  "
                 <<probeVars[admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ci_ei] =  "
                 <<probeVars[admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_exx_ei] =  "
                 <<probeVars[admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_cx_ci] =  "
                 <<probeVars[admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_ex_ei] =  "
                 <<probeVars[admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bii_ei] =  "
                 <<probeVars[admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bii_ci] =  "
                 <<probeVars[admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << " probeVars[admsProbeID_V_bi_ci] =  "
                 <<probeVars[admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_c] =  "
                 <<staticContributions[admsNodeID_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_c].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_c][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_c] =  "
                 <<dynamicContributions[admsNodeID_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_c].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_c][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_c] =  "
                 <<Jdxp_static[admsNodeID_c] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_c] =  "
                 <<Jdxp_dynamic[admsNodeID_c] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_b] =  "
                 <<staticContributions[admsNodeID_b] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_b].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_b][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_b] =  "
                 <<dynamicContributions[admsNodeID_b] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_b].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_b][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_b] =  "
                 <<Jdxp_static[admsNodeID_b] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_b] =  "
                 <<Jdxp_dynamic[admsNodeID_b] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_e] =  "
                 <<staticContributions[admsNodeID_e] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_e].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_e][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_e] =  "
                 <<dynamicContributions[admsNodeID_e] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_e].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_e][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_e] =  "
                 <<Jdxp_static[admsNodeID_e] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_e] =  "
                 <<Jdxp_dynamic[admsNodeID_e] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_t] =  "
                 <<staticContributions[admsNodeID_t] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_t].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_t][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_t] =  "
                 <<dynamicContributions[admsNodeID_t] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_t].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_t][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_t] =  "
                 <<Jdxp_static[admsNodeID_t] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_t] =  "
                 <<Jdxp_dynamic[admsNodeID_t] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ei] =  "
                 <<staticContributions[admsNodeID_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ei][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ei] =  "
                 <<dynamicContributions[admsNodeID_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ei].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_ei] =  "
                 <<Jdxp_static[admsNodeID_ei] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_ei] =  "
                 <<Jdxp_dynamic[admsNodeID_ei] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_bi] =  "
                 <<staticContributions[admsNodeID_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_bi] =  "
                 <<dynamicContributions[admsNodeID_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bi].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_bi] =  "
                 <<Jdxp_static[admsNodeID_bi] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_bi] =  "
                 <<Jdxp_dynamic[admsNodeID_bi] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_bii] =  "
                 <<staticContributions[admsNodeID_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_bii].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_bii][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_bii] =  "
                 <<dynamicContributions[admsNodeID_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_bii].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_bii] =  "
                 <<Jdxp_static[admsNodeID_bii] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_bii] =  "
                 <<Jdxp_dynamic[admsNodeID_bii] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ci] =  "
                 <<staticContributions[admsNodeID_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ci] =  "
                 <<dynamicContributions[admsNodeID_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ci].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_ci] =  "
                 <<Jdxp_static[admsNodeID_ci] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_ci] =  "
                 <<Jdxp_dynamic[admsNodeID_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ti] =  "
                 <<staticContributions[admsNodeID_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ti].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ti] =  "
                 <<dynamicContributions[admsNodeID_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ti].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ti][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_ti] =  "
                 <<Jdxp_static[admsNodeID_ti] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_ti] =  "
                 <<Jdxp_dynamic[admsNodeID_ti] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_ex] =  "
                 <<staticContributions[admsNodeID_ex] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_ex].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_ex][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_ex] =  "
                 <<dynamicContributions[admsNodeID_ex] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_ex].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_ex][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_ex] =  "
                 <<Jdxp_static[admsNodeID_ex] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_ex] =  "
                 <<Jdxp_dynamic[admsNodeID_ex] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_exx] =  "
                 <<staticContributions[admsNodeID_exx] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_exx].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_exx][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_exx] =  "
                 <<dynamicContributions[admsNodeID_exx] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_exx].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_exx][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_exx] =  "
                 <<Jdxp_static[admsNodeID_exx] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_exx] =  "
                 <<Jdxp_dynamic[admsNodeID_exx] << std::endl;
    Xyce::dout() << " staticContributions[admsNodeID_cx] =  "
                 <<staticContributions[admsNodeID_cx] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsNodeID_cx].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsNodeID_cx][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsNodeID_cx] =  "
                 <<dynamicContributions[admsNodeID_cx] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsNodeID_cx].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsNodeID_cx][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " Jdxp_static[admsNodeID_cx] =  "
                 <<Jdxp_static[admsNodeID_cx] << std::endl;
    Xyce::dout() << " Jdxp_dynamic[admsNodeID_cx] =  "
                 <<Jdxp_dynamic[admsNodeID_cx] << std::endl;
    Xyce::dout() << " staticContributions[admsBRA_ID_b_bi] =  "
                 <<staticContributions[admsBRA_ID_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsBRA_ID_b_bi][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsBRA_ID_b_bi] =  "
                 <<dynamicContributions[admsBRA_ID_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_b_bi].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsBRA_ID_e_ei] =  "
                 <<staticContributions[admsBRA_ID_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsBRA_ID_e_ei][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsBRA_ID_e_ei] =  "
                 <<dynamicContributions[admsBRA_ID_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_e_ei].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " staticContributions[admsBRA_ID_c_ci] =  "
                 <<staticContributions[admsBRA_ID_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_t_ti) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_b_c) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_c_GND) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_b_GND) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_cx_bii) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_exx_bii) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ex_bii) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_bi) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_c_ci) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_e_ei) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_b_bi) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ti_GND) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ci_ei) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_exx_ei) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_cx_ci) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ex_ei) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_ei) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_ci) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    staticContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bi_ci) =  " <<d_staticContributions[admsBRA_ID_c_ci][admsProbeID_V_bi_ci] << std::endl;
    Xyce::dout() << " dynamicContributions[admsBRA_ID_c_ci] =  "
                 <<dynamicContributions[admsBRA_ID_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_t_ti) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_t_ti] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_b_c) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_b_c] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_c_GND) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_c_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_b_GND) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_b_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_cx_bii) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_cx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_exx_bii) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_exx_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ex_bii) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_ex_bii] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_bi) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_c_ci) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_e_ei) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_e_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_I_b_bi) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_b_bi] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ti_GND) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_ti_GND] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ci_ei) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_ci_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_exx_ei) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_exx_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_cx_ci) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_cx_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_ex_ei) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_ex_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_ei) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_ei] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bii_ci) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_bii_ci] << std::endl;
    Xyce::dout() << "    dynamicContributions[admsBRA_ID_c_ci].dx(admsProbeID_V_bi_ci) =  " <<d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_V_bi_ci] << std::endl;

    if (!origFlag)
      Xyce::dout() << "This step was limited by this device." << std::endl;
  }


  if (loadLeadCurrent)
  {
    // If needed, we must now copy all the data from staticContributions
    // and dynamicContributionsinto the lead current F vector
    // Must make sure all collapsed node contributions get summed into the
    // external nodes properly.
    for ( int unmappedNode=0; unmappedNode < 4 ; unmappedNode++)
    {
      leadCurrentF[unmappedNode] = 0.0;
      leadCurrentQ[unmappedNode] = 0.0;
    }
    for ( int unmappedNode=0; unmappedNode < 12; unmappedNode++)
    {
      if (nodeMap[unmappedNode] < 4 && nodeMap[unmappedNode] != -1 )
      {
        leadCurrentF[nodeMap[unmappedNode]] += staticContributions[unmappedNode];
        leadCurrentQ[nodeMap[unmappedNode]] += dynamicContributions[unmappedNode];
      }
    }
  }
  return true;
}


//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEdFdx
// Purpose       :
// Special Notes : Load the dFdx ("static jacobian") matrix
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEdFdx()
{
  bool bsuccess = true;
  Linear::Matrix & dFdx = *(extData.dFdxMatrixPtr);

#ifndef Xyce_NONPOINTER_MATRIX_LOAD
  (*f_bi_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_ti_GND];
  (*f_ci_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND];
  (*f_bi_Equ_bi_Node_Ptr) +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  (*f_bi_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  (*f_ci_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*f_ci_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*f_bii_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_ti_GND];
  (*f_bii_Equ_bii_Node_Ptr) +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii] -d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii] -d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  (*f_bii_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  (*f_ci_Equ_bii_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci];
  (*f_bii_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei];
  (*f_ci_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei];
  (*f_ei_Equ_bii_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  (*f_ei_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  (*f_ei_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND];
  (*f_ei_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei];
  (*f_ex_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_ex][admsProbeID_V_ti_GND];
  (*f_ex_Equ_ex_Node_Ptr) +=  +d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii] +d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei];
  (*f_ex_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei];
  (*f_ei_Equ_ex_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei];
  (*f_exx_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_exx][admsProbeID_V_ti_GND];
  (*f_exx_Equ_exx_Node_Ptr) +=  +d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii] +d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei];
  (*f_exx_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei];
  (*f_ei_Equ_exx_Node_Ptr) +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei];
  (*f_cx_Equ_ti_Node_Ptr) +=  +d_staticContributions[admsNodeID_cx][admsProbeID_V_ti_GND];
  (*f_cx_Equ_cx_Node_Ptr) +=  +d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii] +d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci];
  (*f_cx_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci];
  (*f_ci_Equ_cx_Node_Ptr) +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci];
  (*f_bii_Equ_bi_Node_Ptr) +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi];
  (*f_bi_Equ_bii_Node_Ptr) +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi];
  (*f_ex_Equ_bii_Node_Ptr) +=  -d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii];
  (*f_bii_Equ_ex_Node_Ptr) +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii];
  (*f_exx_Equ_bii_Node_Ptr) +=  -d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii];
  (*f_bii_Equ_exx_Node_Ptr) +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii];
  (*f_cx_Equ_bii_Node_Ptr) +=  -d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii];
  (*f_bii_Equ_cx_Node_Ptr) +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii];
  (*f_ti_Equ_bi_Node_Ptr) +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci];
  (*f_ti_Equ_ci_Node_Ptr) +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci] +d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci];
  (*f_ti_Equ_ei_Node_Ptr) +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] -d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei];
  (*f_ti_Equ_bii_Node_Ptr) +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci];
  (*f_ti_Equ_ti_Node_Ptr) +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti] +d_staticContributions[admsNodeID_ti][admsProbeID_V_ti_GND];
  (*f_t_Equ_t_Node_Ptr) +=  +d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti];
  (*f_t_Equ_ti_Node_Ptr) +=  -d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti];
  (*f_ti_Equ_t_Node_Ptr) +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  (*f_c_Equ_BRA_c_ci_Var_Ptr) += d_staticContributions[admsNodeID_c][admsProbeID_I_c_ci];
  (*f_b_Equ_BRA_b_bi_Var_Ptr) += d_staticContributions[admsNodeID_b][admsProbeID_I_b_bi];
  (*f_e_Equ_BRA_e_ei_Var_Ptr) += d_staticContributions[admsNodeID_e][admsProbeID_I_e_ei];
  (*f_ei_Equ_BRA_e_ei_Var_Ptr) += d_staticContributions[admsNodeID_ei][admsProbeID_I_e_ei];
  (*f_bi_Equ_BRA_b_bi_Var_Ptr) += d_staticContributions[admsNodeID_bi][admsProbeID_I_b_bi];
  (*f_ci_Equ_BRA_c_ci_Var_Ptr) += d_staticContributions[admsNodeID_ci][admsProbeID_I_c_ci];
  // there also need to be extra loads for branch b,bi
  // Load for branch b,bi equ var b
  (*f_BRA_b_bi_Equ_b_Node_Ptr) +=  -1;
  // Load for branch b,bi equ var bi
  (*f_BRA_b_bi_Equ_bi_Node_Ptr) +=  +1;
  //load for branch b,bi equ branch b,bi var
  (*f_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr) += d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi];
  // there also need to be extra loads for branch e,ei
  // Load for branch e,ei equ var e
  (*f_BRA_e_ei_Equ_e_Node_Ptr) +=  -1;
  // Load for branch e,ei equ var ei
  (*f_BRA_e_ei_Equ_ei_Node_Ptr) +=  +1;
  //load for branch e,ei equ branch e,ei var
  (*f_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr) += d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei];
  // there also need to be extra loads for branch c,ci
  // Load for branch c,ci equ var c
  (*f_BRA_c_ci_Equ_c_Node_Ptr) +=  -1;
  // Load for branch c,ci equ var ci
  (*f_BRA_c_ci_Equ_ci_Node_Ptr) +=  +1;
  //load for branch c,ci equ branch c,ci var
  (*f_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr) += d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci];

#else
  //use the offsets instead of pointers
  dFdx[li_bi][A_bi_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_ti_GND];
  dFdx[li_ci][A_ci_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_ti_GND];
  dFdx[li_bi][A_bi_Equ_bi_NodeOffset] +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi] +d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  dFdx[li_bi][A_bi_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  dFdx[li_ci][A_ci_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dFdx[li_ci][A_ci_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -d_staticContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dFdx[li_bii][A_bii_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_ti_GND];
  dFdx[li_bii][A_bii_Equ_bii_NodeOffset] +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii] -d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii] -d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  dFdx[li_bii][A_bii_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  dFdx[li_ci][A_ci_Equ_bii_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ci];
  dFdx[li_bii][A_bii_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_ei];
  dFdx[li_ci][A_ci_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_ci][admsProbeID_V_bii_ei];
  dFdx[li_ei][A_ei_Equ_bii_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  dFdx[li_ei][A_ei_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  dFdx[li_ei][A_ei_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ti_GND];
  dFdx[li_ei][A_ei_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei] -d_staticContributions[admsNodeID_ei][admsProbeID_V_bii_ei];
  dFdx[li_ex][A_ex_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_ex][admsProbeID_V_ti_GND];
  dFdx[li_ex][A_ex_Equ_ex_NodeOffset] +=  +d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii] +d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei];
  dFdx[li_ex][A_ex_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_ei];
  dFdx[li_ei][A_ei_Equ_ex_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_ex_ei];
  dFdx[li_exx][A_exx_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_exx][admsProbeID_V_ti_GND];
  dFdx[li_exx][A_exx_Equ_exx_NodeOffset] +=  +d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii] +d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei];
  dFdx[li_exx][A_exx_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_ei];
  dFdx[li_ei][A_ei_Equ_exx_NodeOffset] +=  +d_staticContributions[admsNodeID_ei][admsProbeID_V_exx_ei];
  dFdx[li_cx][A_cx_Equ_ti_NodeOffset] +=  +d_staticContributions[admsNodeID_cx][admsProbeID_V_ti_GND];
  dFdx[li_cx][A_cx_Equ_cx_NodeOffset] +=  +d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii] +d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci];
  dFdx[li_cx][A_cx_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_ci];
  dFdx[li_ci][A_ci_Equ_cx_NodeOffset] +=  +d_staticContributions[admsNodeID_ci][admsProbeID_V_cx_ci];
  dFdx[li_bii][A_bii_Equ_bi_NodeOffset] +=  -d_staticContributions[admsNodeID_bii][admsProbeID_V_bii_bi];
  dFdx[li_bi][A_bi_Equ_bii_NodeOffset] +=  +d_staticContributions[admsNodeID_bi][admsProbeID_V_bii_bi];
  dFdx[li_ex][A_ex_Equ_bii_NodeOffset] +=  -d_staticContributions[admsNodeID_ex][admsProbeID_V_ex_bii];
  dFdx[li_bii][A_bii_Equ_ex_NodeOffset] +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_ex_bii];
  dFdx[li_exx][A_exx_Equ_bii_NodeOffset] +=  -d_staticContributions[admsNodeID_exx][admsProbeID_V_exx_bii];
  dFdx[li_bii][A_bii_Equ_exx_NodeOffset] +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_exx_bii];
  dFdx[li_cx][A_cx_Equ_bii_NodeOffset] +=  -d_staticContributions[admsNodeID_cx][admsProbeID_V_cx_bii];
  dFdx[li_bii][A_bii_Equ_cx_NodeOffset] +=  +d_staticContributions[admsNodeID_bii][admsProbeID_V_cx_bii];
  dFdx[li_ti][A_ti_Equ_bi_NodeOffset] +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci];
  dFdx[li_ti][A_ti_Equ_ci_NodeOffset] +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci] +d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei] -d_staticContributions[admsNodeID_ti][admsProbeID_V_bi_ci];
  dFdx[li_ti][A_ti_Equ_ei_NodeOffset] +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] -d_staticContributions[admsNodeID_ti][admsProbeID_V_ci_ei];
  dFdx[li_ti][A_ti_Equ_bii_NodeOffset] +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ei] +d_staticContributions[admsNodeID_ti][admsProbeID_V_bii_ci];
  dFdx[li_ti][A_ti_Equ_ti_NodeOffset] +=  -d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti] +d_staticContributions[admsNodeID_ti][admsProbeID_V_ti_GND];
  dFdx[li_t][A_t_Equ_t_NodeOffset] +=  +d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti];
  dFdx[li_t][A_t_Equ_ti_NodeOffset] +=  -d_staticContributions[admsNodeID_t][admsProbeID_V_t_ti];
  dFdx[li_ti][A_ti_Equ_t_NodeOffset] +=  +d_staticContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  dFdx[li_c][A_c_Equ_BRA_c_ci_Var_Offset] += d_staticContributions[admsNodeID_c][admsProbeID_I_c_ci];
  dFdx[li_b][A_b_Equ_BRA_b_bi_Var_Offset] += d_staticContributions[admsNodeID_b][admsProbeID_I_b_bi];
  dFdx[li_e][A_e_Equ_BRA_e_ei_Var_Offset] += d_staticContributions[admsNodeID_e][admsProbeID_I_e_ei];
  dFdx[li_ei][A_ei_Equ_BRA_e_ei_Var_Offset] += d_staticContributions[admsNodeID_ei][admsProbeID_I_e_ei];
  dFdx[li_bi][A_bi_Equ_BRA_b_bi_Var_Offset] += d_staticContributions[admsNodeID_bi][admsProbeID_I_b_bi];
  dFdx[li_ci][A_ci_Equ_BRA_c_ci_Var_Offset] += d_staticContributions[admsNodeID_ci][admsProbeID_I_c_ci];
  // there also need to be extra loads for branch b,bi
  // Load for branch b,bi equ var b
  dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_b_Node_Offset] +=  -1;
  // Load for branch b,bi equ var bi
  dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_bi_Node_Offset] +=  +1;
  //load for branch b,bi equ branch b,bi var
  dFdx[li_BRA_b_bi][A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset] += d_staticContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi];
  // there also need to be extra loads for branch e,ei
  // Load for branch e,ei equ var e
  dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_e_Node_Offset] +=  -1;
  // Load for branch e,ei equ var ei
  dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_ei_Node_Offset] +=  +1;
  //load for branch e,ei equ branch e,ei var
  dFdx[li_BRA_e_ei][A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset] += d_staticContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei];
  // there also need to be extra loads for branch c,ci
  // Load for branch c,ci equ var c
  dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_c_Node_Offset] +=  -1;
  // Load for branch c,ci equ var ci
  dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_ci_Node_Offset] +=  +1;
  //load for branch c,ci equ branch c,ci var
  dFdx[li_BRA_c_ci][A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset] += d_staticContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci];

#endif

  return bsuccess;
}


//-----------------------------------------------------------------------------
// Function      : Instance::loadDAEdQdx
// Purpose       :
// Special Notes : Load the dQdx ("dynamic jacobian") matrix
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::loadDAEdQdx()
{
  bool bsuccess = true;
  Linear::Matrix & dQdx = *(extData.dQdxMatrixPtr);

#ifndef Xyce_NONPOINTER_MATRIX_LOAD
  (*q_bi_Equ_ti_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ti_GND];
  (*q_ci_Equ_ti_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ti_GND];
  (*q_bi_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  (*q_bi_Equ_ci_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  (*q_ci_Equ_bi_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*q_ci_Equ_ci_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  (*q_bii_Equ_ti_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ti_GND];
  (*q_bii_Equ_bii_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  (*q_bii_Equ_ci_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  (*q_ci_Equ_bii_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci];
  (*q_bii_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei];
  (*q_ci_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei];
  (*q_ei_Equ_bii_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  (*q_ei_Equ_ci_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  (*q_ei_Equ_ti_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ti_GND];
  (*q_ei_Equ_ei_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  (*q_b_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c] +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_GND];
  (*q_c_Equ_c_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c] +d_dynamicContributions[admsNodeID_c][admsProbeID_V_c_GND];
  (*q_b_Equ_c_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c];
  (*q_c_Equ_b_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c];
  (*q_ti_Equ_ti_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  (*q_t_Equ_t_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti];
  (*q_t_Equ_ti_Node_Ptr) +=  -d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti];
  (*q_ti_Equ_t_Node_Ptr) +=  +d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  (*q_c_Equ_BRA_c_ci_Var_Ptr) += d_dynamicContributions[admsNodeID_c][admsProbeID_I_c_ci];
  (*q_b_Equ_BRA_b_bi_Var_Ptr) += d_dynamicContributions[admsNodeID_b][admsProbeID_I_b_bi];
  (*q_e_Equ_BRA_e_ei_Var_Ptr) += d_dynamicContributions[admsNodeID_e][admsProbeID_I_e_ei];
  (*q_ei_Equ_BRA_e_ei_Var_Ptr) += d_dynamicContributions[admsNodeID_ei][admsProbeID_I_e_ei];
  (*q_bi_Equ_BRA_b_bi_Var_Ptr) += d_dynamicContributions[admsNodeID_bi][admsProbeID_I_b_bi];
  (*q_ci_Equ_BRA_c_ci_Var_Ptr) += d_dynamicContributions[admsNodeID_ci][admsProbeID_I_c_ci];
  // there also need to be extra loads for branch b,bi
  // Load for branch b,bi equ var b
  // Load for branch b,bi equ var bi
  //load for branch b,bi equ branch b,bi var
  (*q_BRA_b_bi_Equ_BRA_b_bi_Var_Ptr) += d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi];
  // there also need to be extra loads for branch e,ei
  // Load for branch e,ei equ var e
  // Load for branch e,ei equ var ei
  //load for branch e,ei equ branch e,ei var
  (*q_BRA_e_ei_Equ_BRA_e_ei_Var_Ptr) += d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei];
  // there also need to be extra loads for branch c,ci
  // Load for branch c,ci equ var c
  // Load for branch c,ci equ var ci
  //load for branch c,ci equ branch c,ci var
  (*q_BRA_c_ci_Equ_BRA_c_ci_Var_Ptr) += d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci];

#else
  //use the offsets instead of pointers
  dQdx[li_bi][A_bi_Equ_ti_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_ti_GND];
  dQdx[li_ci][A_ci_Equ_ti_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_ti_GND];
  dQdx[li_bi][A_bi_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  dQdx[li_bi][A_bi_Equ_ci_NodeOffset] +=  -d_dynamicContributions[admsNodeID_bi][admsProbeID_V_bi_ci];
  dQdx[li_ci][A_ci_Equ_bi_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dQdx[li_ci][A_ci_Equ_ci_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci] -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bi_ci];
  dQdx[li_bii][A_bii_Equ_ti_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ti_GND];
  dQdx[li_bii][A_bii_Equ_bii_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  dQdx[li_bii][A_bii_Equ_ci_NodeOffset] +=  +d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ci];
  dQdx[li_ci][A_ci_Equ_bii_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ci];
  dQdx[li_bii][A_bii_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_ci_ei] -d_dynamicContributions[admsNodeID_bii][admsProbeID_V_bii_ei];
  dQdx[li_ci][A_ci_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ci][admsProbeID_V_bii_ei];
  dQdx[li_ei][A_ei_Equ_bii_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci];
  dQdx[li_ei][A_ei_Equ_ci_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ci] +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  dQdx[li_ei][A_ei_Equ_ti_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ti_GND];
  dQdx[li_ei][A_ei_Equ_ei_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_bii_ei] -d_dynamicContributions[admsNodeID_ei][admsProbeID_V_ci_ei];
  dQdx[li_b][A_b_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c] +d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_GND];
  dQdx[li_c][A_c_Equ_c_NodeOffset] +=  -d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c] +d_dynamicContributions[admsNodeID_c][admsProbeID_V_c_GND];
  dQdx[li_b][A_b_Equ_c_NodeOffset] +=  -d_dynamicContributions[admsNodeID_b][admsProbeID_V_b_c];
  dQdx[li_c][A_c_Equ_b_NodeOffset] +=  +d_dynamicContributions[admsNodeID_c][admsProbeID_V_b_c];
  dQdx[li_ti][A_ti_Equ_ti_NodeOffset] +=  -d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  dQdx[li_t][A_t_Equ_t_NodeOffset] +=  +d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti];
  dQdx[li_t][A_t_Equ_ti_NodeOffset] +=  -d_dynamicContributions[admsNodeID_t][admsProbeID_V_t_ti];
  dQdx[li_ti][A_ti_Equ_t_NodeOffset] +=  +d_dynamicContributions[admsNodeID_ti][admsProbeID_V_t_ti];
  dQdx[li_c][A_c_Equ_BRA_c_ci_Var_Offset] += d_dynamicContributions[admsNodeID_c][admsProbeID_I_c_ci];
  dQdx[li_b][A_b_Equ_BRA_b_bi_Var_Offset] += d_dynamicContributions[admsNodeID_b][admsProbeID_I_b_bi];
  dQdx[li_e][A_e_Equ_BRA_e_ei_Var_Offset] += d_dynamicContributions[admsNodeID_e][admsProbeID_I_e_ei];
  dQdx[li_ei][A_ei_Equ_BRA_e_ei_Var_Offset] += d_dynamicContributions[admsNodeID_ei][admsProbeID_I_e_ei];
  dQdx[li_bi][A_bi_Equ_BRA_b_bi_Var_Offset] += d_dynamicContributions[admsNodeID_bi][admsProbeID_I_b_bi];
  dQdx[li_ci][A_ci_Equ_BRA_c_ci_Var_Offset] += d_dynamicContributions[admsNodeID_ci][admsProbeID_I_c_ci];
  // there also need to be extra loads for branch b,bi
  // Load for branch b,bi equ var b
  // Load for branch b,bi equ var bi
  //load for branch b,bi equ branch b,bi var
  dQdx[li_BRA_b_bi][A_BRA_b_bi_Equ_BRA_b_bi_Var_Offset] += d_dynamicContributions[admsBRA_ID_b_bi][admsProbeID_I_b_bi];
  // there also need to be extra loads for branch e,ei
  // Load for branch e,ei equ var e
  // Load for branch e,ei equ var ei
  //load for branch e,ei equ branch e,ei var
  dQdx[li_BRA_e_ei][A_BRA_e_ei_Equ_BRA_e_ei_Var_Offset] += d_dynamicContributions[admsBRA_ID_e_ei][admsProbeID_I_e_ei];
  // there also need to be extra loads for branch c,ci
  // Load for branch c,ci equ var c
  // Load for branch c,ci equ var ci
  //load for branch c,ci equ branch c,ci var
  dQdx[li_BRA_c_ci][A_BRA_c_ci_Equ_BRA_c_ci_Var_Offset] += d_dynamicContributions[admsBRA_ID_c_ci][admsProbeID_I_c_ci];


#endif
  return bsuccess;
}




//-----------------------------------------------------------------------------
// Function      : Instance::updateTemperature
// Purpose       : Set temperature and update any parameters that depend on it
// Special Notes : In Xyce ADMS, we'll simply copy the temperature, which is
//                 in Kelvin, to our "admsTemperature" variable, which needs
//                 to be in Celsius.
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Instance::updateTemperature(const double & temperatureTemp)
{

  admsTemperature = temperatureTemp;
  adms_vt_nom = adms_vt(temperatureTemp);

  return true;
}

// Class Model
//-----------------------------------------------------------------------------
// Function      : Model::processParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
bool Model::processParams()
{

  // Set any non-constant parameter defaults:
  // Set any parameters that were not given and whose defaults depend on other
  // parameters:

  // set internal model type based on model card type
  if (getType() == "pnp" || getType() == "PNP")
    dtype = -1;



  // Now we need to check that any parameters are within their ranges as
  // specified in the verilog:

  //    Parameter Mode : [ 0, 4 ]
  if ( (!((Mode >=0 && Mode <=4 ))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Mode value " << Mode << " out of range [ 0, 4 ]";
  }

  //    Parameter Noise : [ 0, 4 ]
  if ( (!((Noise >=0 && Noise <=4 ))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Noise value " << Noise << " out of range [ 0, 4 ]";
  }

  //    Parameter Debug : [ 0,  (+inf) [
  if ( (!((Debug >=0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Debug value " << Debug << " out of range [ 0,  (+inf) [";
  }

  //    Parameter DebugPlus : [ 0,  (+inf) [
  if ( (!((DebugPlus >=0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter DebugPlus value " << DebugPlus << " out of range [ 0,  (+inf) [";
  }

  //    Parameter Temp : [ (-273.15),  (+inf) [
  if ( (!((Temp >=(-273.15)))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Temp value " << Temp << " out of range [ (-273.15),  (+inf) [";
  }

  //    Parameter Rth : [ 0.0,  (+inf) [
  if ( (!((Rth >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rth value " << Rth << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cth : [ 0.0,  (+inf) [
  if ( (!((Cth >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cth value " << Cth << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter N : ] 0,  (+inf) [
  if ( (!((N >0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter N value " << N << " out of range ] 0,  (+inf) [";
  }

  //    Parameter L : ] 0.0,  (+inf) [
  if ( (!((L >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter L value " << L << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter W : ] 0.0,  (+inf) [
  if ( (!((W >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter W value " << W << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Jsf : [ 0.0,  (+inf) [
  if ( (!((Jsf >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jsf value " << Jsf << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter nf : [ 0.0,  (+inf) [
  if ( (!((nf >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter nf value " << nf << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Vg : [ (-2.0),  (+inf) [
  if ( (!((Vg >=(-2.0)))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vg value " << Vg << " out of range [ (-2.0),  (+inf) [";
  }

  //    Parameter Jse : [ 0.0,  (+inf) [
  if ( (!((Jse >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jse value " << Jse << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter ne : [ 0.0,  (+inf) [
  if ( (!((ne >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter ne value " << ne << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Rbxx : ] 0.0,  (+inf) [
  if ( (!((Rbxx >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rbxx value " << Rbxx << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Vgb : [ 0.0,  (+inf) [
  if ( (!((Vgb >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vgb value " << Vgb << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Jsee : [ 0.0,  (+inf) [
  if ( (!((Jsee >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jsee value " << Jsee << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter nee : [ 0.0,  (+inf) [
  if ( (!((nee >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter nee value " << nee << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Rbbxx : ] 0.0,  (+inf) [
  if ( (!((Rbbxx >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rbbxx value " << Rbbxx << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Vgbb : [ 0.0,  (+inf) [
  if ( (!((Vgbb >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vgbb value " << Vgbb << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Jsr : [ 0.0,  (+inf) [
  if ( (!((Jsr >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jsr value " << Jsr << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter nr : [ 0.0,  (+inf) [
  if ( (!((nr >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter nr value " << nr << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Vgr : [ 0.0,  (+inf) [
  if ( (!((Vgr >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vgr value " << Vgr << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter XCjc : [ 0.0, 1.0 [
  if ( (!((XCjc >=0.0 && XCjc <1.0 ))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter XCjc value " << XCjc << " out of range [ 0.0, 1.0 [";
  }

  //    Parameter Jsc : [ 0.0,  (+inf) [
  if ( (!((Jsc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jsc value " << Jsc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter nc : [ 0.0,  (+inf) [
  if ( (!((nc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter nc value " << nc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Rcxx : ] 0.0,  (+inf) [
  if ( (!((Rcxx >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rcxx value " << Rcxx << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Vgc : [ 0.0,  (+inf) [
  if ( (!((Vgc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vgc value " << Vgc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Bf : [ 0.0,  (+inf) [
  if ( (!((Bf >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Bf value " << Bf << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter kBeta : [ 0.0,  (+inf) [
  if ( (!((kBeta >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter kBeta value " << kBeta << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Br : [ 0.0,  (+inf) [
  if ( (!((Br >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Br value " << Br << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter VAF : [ 0.0,  (+inf) [
  if ( (!((VAF >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter VAF value " << VAF << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter VAR : [ 0.0,  (+inf) [
  if ( (!((VAR >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter VAR value " << VAR << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter IKF : [ 0.0,  (+inf) [
  if ( (!((IKF >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter IKF value " << IKF << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter IKR : [ 0.0,  (+inf) [
  if ( (!((IKR >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter IKR value " << IKR << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Mc : [ 0.0,  (+inf) [
  if ( (!((Mc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Mc value " << Mc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter BVceo : [ 0.0,  (+inf) [
  if ( (!((BVceo >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter BVceo value " << BVceo << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter kc : [ 0.0,  (+inf) [
  if ( (!((kc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter kc value " << kc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter BVebo : [ 0.0,  (+inf) [
  if ( (!((BVebo >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter BVebo value " << BVebo << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Tr : [ 0.0,  (+inf) [
  if ( (!((Tr >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Tr value " << Tr << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Trx : [ 0.0,  (+inf) [
  if ( (!((Trx >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Trx value " << Trx << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Tf : [ 0.0,  (+inf) [
  if ( (!((Tf >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Tf value " << Tf << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Tft : [ 0.0,  (+inf) [
  if ( (!((Tft >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Tft value " << Tft << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Thcs : [ 0.0,  (+inf) [
  if ( (!((Thcs >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Thcs value " << Thcs << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Ahc : [ 0.0,  (+inf) [
  if ( (!((Ahc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Ahc value " << Ahc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cje : [ 0.0,  (+inf) [
  if ( (!((Cje >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cje value " << Cje << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter mje : [ 0.0, 1 [
  if ( (!((mje >=0.0 && mje <1 ))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter mje value " << mje << " out of range [ 0.0, 1 [";
  }

  //    Parameter Vje : [ 0.0,  (+inf) [
  if ( (!((Vje >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vje value " << Vje << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cjc : [ 0.0,  (+inf) [
  if ( (!((Cjc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cjc value " << Cjc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter mjc : [ 0.0,  (+inf) [
  if ( (!((mjc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter mjc value " << mjc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Vjc : [ 0.0,  (+inf) [
  if ( (!((Vjc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vjc value " << Vjc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter kjc :  ] (-inf)  (+inf) [

  //    Parameter Cmin : [ 0.0,  (+inf) [
  if ( (!((Cmin >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cmin value " << Cmin << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter J0 : [ 0.0,  (+inf) [
  if ( (!((J0 >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter J0 value " << J0 << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter XJ0 : [ 0.0, 1.0 ]
  if ( (!((XJ0 >=0.0 && XJ0 <=1.0 ))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter XJ0 value " << XJ0 << " out of range [ 0.0, 1.0 ]";
  }

  //    Parameter Rci0 : ] 0.0,  (+inf) [
  if ( (!((Rci0 >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rci0 value " << Rci0 << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Jk : [ 0.0,  (+inf) [
  if ( (!((Jk >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Jk value " << Jk << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter RJk : [ 0.0,  (+inf) [
  if ( (!((RJk >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter RJk value " << RJk << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Vces : [ 0.0,  (+inf) [
  if ( (!((Vces >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Vces value " << Vces << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Rc : ] 0.0,  (+inf) [
  if ( (!((Rc >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rc value " << Rc << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Re : ] 0.0,  (+inf) [
  if ( (!((Re >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Re value " << Re << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Rb : ] 0.0,  (+inf) [
  if ( (!((Rb >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rb value " << Rb << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Rb2 : ] 0.0,  (+inf) [
  if ( (!((Rb2 >0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Rb2 value " << Rb2 << " out of range ] 0.0,  (+inf) [";
  }

  //    Parameter Lc : [ 0.0,  (+inf) [
  if ( (!((Lc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Lc value " << Lc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Le : [ 0.0,  (+inf) [
  if ( (!((Le >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Le value " << Le << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Lb : [ 0.0,  (+inf) [
  if ( (!((Lb >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Lb value " << Lb << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cq : [ 0.0,  (+inf) [
  if ( (!((Cq >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cq value " << Cq << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cpb : [ 0.0,  (+inf) [
  if ( (!((Cpb >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cpb value " << Cpb << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Cpc : [ 0.0,  (+inf) [
  if ( (!((Cpc >=0.0))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Cpc value " << Cpc << " out of range [ 0.0,  (+inf) [";
  }

  //    Parameter Tnom : [ (-273.15),  (+inf) [
  if ( (!((Tnom >=(-273.15)))) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter Tnom value " << Tnom << " out of range [ (-273.15),  (+inf) [";
  }

  //    Parameter dtype : [ (-1), 1 ][ 0, 0 ]
  if ( (!((dtype >=(-1) && dtype <=1 )) || (dtype >=0 && dtype <=0 )) )
  {
    UserWarning(*this) << "ADMSHBT_X: Parameter dtype value " << dtype << " out of range [ (-1), 1 ] or in excluded range [ 0, 0 ]";
  }

  // and of course, this routine is where we should put the initial_model
  // stuff


  return true;
}
//----------------------------------------------------------------------------
// Function      : Model::processInstanceParams
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//----------------------------------------------------------------------------
bool Model::processInstanceParams()
{

  std::vector<Instance*>::iterator iter;
  std::vector<Instance*>::iterator first = instanceContainer.begin();
  std::vector<Instance*>::iterator last  = instanceContainer.end();

  for (iter=first; iter!=last; ++iter)
  {
    (*iter)->processParams();
  }

  return true;
}

//-----------------------------------------------------------------------------
// Function      : Model::Model
// Purpose       : model block constructor
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
Model::Model(
   const Configuration & configuration,
   const ModelBlock &    model_block,
   const FactoryBlock &  factory_block)
  : DeviceModel(model_block, configuration.getModelParameters(), factory_block),
    Mode(1),
    Noise(1),
    Debug(0),
    DebugPlus(0),
    Temp(25.0),
    Rth(0.1),
    Cth(700*1.0e-9),
    N(1),
    L(30*1.0e-6),
    W(3*1.0e-6),
    Jsf(20e-24),
    nf(1.0),
    Vg(1.3),
    Jse(0.0),
    ne(0.0),
    Rbxx(1e6),
    Vgb(0.0),
    Jsee(0.0),
    nee(0.0),
    Rbbxx(1e6),
    Vgbb(0.0),
    Jsr(20e-18),
    nr(1.0),
    Vgr(0.0),
    XCjc(0.5),
    Jsc(0.0),
    nc(0.0),
    Rcxx(1e6),
    Vgc(0.0),
    Bf(100.0),
    kBeta(0.0),
    Br(1.0),
    VAF(0.0),
    VAR(0.0),
    IKF(0.0),
    IKR(0.0),
    Mc(0.0),
    BVceo(0.0),
    kc(0.0),
    BVebo(0.0),
    Tr(1*1.0e-15),
    Trx(1*1.0e-15),
    Tf(1*1.0e-12),
    Tft(0.0),
    Thcs(0.0),
    Ahc(0.0),
    Cje(1*1.0e-15),
    mje(0.5),
    Vje(1.3),
    Cjc(1*1.0e-15),
    mjc(0.5),
    Vjc(1.3),
    kjc(1.0),
    Cmin(0.1*1.0e-15),
    J0(1e-3),
    XJ0(1.0),
    Rci0(1e-3),
    Jk(4e-4),
    RJk(1e-3),
    Vces(1e-3),
    Rc(1.0),
    Re(1.0),
    Rb(1.0),
    Rb2(1.0),
    Lc(0.0),
    Le(0.0),
    Lb(0.0),
    Cq(0.0),
    Cpb(0.0),
    Cpc(0.0),
    Tnom(20.0),
    dtype(1)
{
  // Set params to constant default values (from parTable):
  setDefaultParams();

  // Set params according to .model line and constant defaults from metadata:
  setModParams(model_block.params);

  if (!given("XYCEADMSMODTEMP"))
    admsModTemp=getDeviceOptions().temp.getImmutableValue<double>();

  // Calculate any parameters specified as expressions:

  updateDependentParameters();

  // calculate dependent (ie computed) params and check for errors:
  processParams();
}

//-----------------------------------------------------------------------------
// Function      : Model::~Model
// Purpose       : destructor
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
Model::~Model()
{
  std::vector<Instance*>::iterator iterI;
  std::vector<Instance*>::iterator firstI = instanceContainer.begin ();
  std::vector<Instance*>::iterator lastI  = instanceContainer.end ();

  // loop over instances:
  for (iterI = firstI; iterI != lastI; ++iterI)
  {
    delete (*iterI);
  }
}

//-----------------------------------------------------------------------------
// Function      : Model::printOutInstances
// Purpose       : debugging tool.
// Special Notes :
// Scope         : public
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
std::ostream &Model::printOutInstances(std::ostream &os) const
{
  std::vector<Instance*>::const_iterator iter;
  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
  std::vector<Instance*>::const_iterator last  = instanceContainer.end();

  int i;
  os << std::endl;
  os << "    name     model name  Parameters" << std::endl;
  for (i=0, iter=first; iter!=last; ++iter, ++i)
  {
    os << "  " << i << ": " << (*iter)->getName() << "      ";
    os << getName();

    os << std::endl;
    os << "TEMP  =  " << (*iter)->Temp << std::endl;
    os << "N  =  " << (*iter)->N << std::endl;
    os << "L  =  " << (*iter)->L << std::endl;
    os << "W  =  " << (*iter)->W << std::endl;
    os << std::endl;
  }

  os << std::endl;

  return os;
}

//-----------------------------------------------------------------------------
// Function      : Model::forEachInstance
// Purpose       :
// Special Notes :
// Scope         : public
// Creator       : David Baur
// Creation Date : 2/4/2014
//-----------------------------------------------------------------------------
/// Apply a device instance "op" to all instances associated with this
/// model
///
/// @param[in] op Operator to apply to all instances.
///
///
void Model::forEachInstance(DeviceInstanceOp &op) const
{
  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
    op(*it);
}

Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
{
  return new DeviceMaster<Traits>(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
}

void
registerDevice(const DeviceCountMap& deviceMap, const std::set<int>& levelSet)
{
  if (deviceMap.empty() ||
      ((deviceMap.find("Q") != deviceMap.end() && (levelSet.find(23)!=levelSet.end()))))
  {
    BJT::registerDevice();

    Config<Traits>::addConfiguration()
      .registerDevice("q", 23)
      .registerModelType("npn", 23)
      .registerModelType("pnp", 23);
  }
}


#ifdef Xyce_ADMS_SENSITIVITIES
//-----------------------------------------------------------------------------
// Function      : evaluateInitialInstance
// Purpose       : Evaluate the statements in the initial_instance block
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateInitialInstance(
   instanceSensStruct & instanceStruct,
   modelSensStruct & modelStruct,
   double admsTemperature, double adms_vt_nom, double ADMSgmin_arg, const Instance & theInstance)
{
}



//-----------------------------------------------------------------------------
// Function      : evaluateInitialModel
// Purpose       : Evaluate the statements in the initial_model block
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateInitialModel(
   modelSensStruct & modelStruct,
   double admsTemperature, double ADMSgmin_arg, const Instance & theInstance)
{
}



//-----------------------------------------------------------------------------
// Function      : evaluateModelEquations
// Purpose       : Evaluate the main module block.  Similar to
//                 updateIntermediateVars, but takes all instance and model
//                 parameters and variables as arguments instead of using
//                 the ones stored in the objects.
// Special Notes : specific for sensitivity use
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
void evaluateModelEquations(
   std::vector <double> & probeVars,
   // probe constants
   const int admsProbeID_V_t_ti,
   const int admsProbeID_V_b_c,
   const int admsProbeID_V_c_GND,
   const int admsProbeID_V_b_GND,
   const int admsProbeID_V_cx_bii,
   const int admsProbeID_V_exx_bii,
   const int admsProbeID_V_ex_bii,
   const int admsProbeID_V_bii_bi,
   const int admsProbeID_I_c_ci,
   const int admsProbeID_I_e_ei,
   const int admsProbeID_I_b_bi,
   const int admsProbeID_V_ti_GND,
   const int admsProbeID_V_ci_ei,
   const int admsProbeID_V_exx_ei,
   const int admsProbeID_V_cx_ci,
   const int admsProbeID_V_ex_ei,
   const int admsProbeID_V_bii_ei,
   const int admsProbeID_V_bii_ci,
   const int admsProbeID_V_bi_ci,
   // node constants
   const int admsNodeID_c,
   const int admsNodeID_b,
   const int admsNodeID_e,
   const int admsNodeID_t,
   const int admsNodeID_ei,
   const int admsNodeID_bi,
   const int admsNodeID_bii,
   const int admsNodeID_ci,
   const int admsNodeID_ti,
   const int admsNodeID_ex,
   const int admsNodeID_exx,
   const int admsNodeID_cx,
   const int admsBRA_ID_b_bi,
   const int admsBRA_ID_e_ei,
   const int admsBRA_ID_c_ci,
   instanceSensStruct & instanceStruct,
   modelSensStruct & modelStruct,
   // basic variables
   double admsTemperature, double adms_vt_nom, double ADMSgmin_arg, std::vector <double> & d_staticContributions_dX, std::vector <double> & d_dynamicContributions_dX, const Instance & theInstance)
{

  // Local variables
  double qbe=0.0;
  double d_qbe_dX=0.0;
  double qbtf=0.0;
  double d_qbtf_dX=0.0;
  double xtff=0.0;
  double d_xtff_dX=0.0;
  double Wh=0.0;
  double d_Wh_dX=0.0;
  double Ih=0.0;
  double d_Ih_dX=0.0;
  double AHC=0.0;
  double d_AHC_dX=0.0;
  double RCIO=0.0;
  double d_RCIO_dX=0.0;
  double InvVpt=0.0;
  double d_InvVpt_dX=0.0;
  double Vlim=0.0;
  double d_Vlim_dX=0.0;
  double qb2=0.0;
  double d_qb2_dX=0.0;
  double qbtra=0.0;
  double d_qbtra_dX=0.0;
  double qbtr=0.0;
  double d_qbtr_dX=0.0;
  double qb1=0.0;
  double d_qb1_dX=0.0;
  double qb2med=0.0;
  double d_qb2med_dX=0.0;
  double xix=0.0;
  double d_xix_dX=0.0;
  double I00=0.0;
  double d_I00_dX=0.0;
  double Ipdiss=0.0;
  double d_Ipdiss_dX=0.0;
  double Icdx=0.0;
  double d_Icdx_dX=0.0;
  double Ibdxx=0.0;
  double d_Ibdxx_dX=0.0;
  double Ibdx=0.0;
  double d_Ibdx_dX=0.0;
  double Ib1=0.0;
  double d_Ib1_dX=0.0;
  double Ib0=0.0;
  double d_Ib0_dX=0.0;
  double EdBeta=0.0;
  double d_EdBeta_dX=0.0;
  double mm=0.0;
  double d_mm_dX=0.0;
  double Vbclin=0.0;
  double d_Vbclin_dX=0.0;
  double epsi=0.0;
  double Ibx=0.0;
  double d_Ibx_dX=0.0;
  double Ib2=0.0;
  double d_Ib2_dX=0.0;
  double Ic1=0.0;
  double d_Ic1_dX=0.0;
  double Ic1r=0.0;
  double d_Ic1r_dX=0.0;
  double Ic0=0.0;
  double d_Ic0_dX=0.0;
  double qb=0.0;
  double d_qb_dX=0.0;
  double q2=0.0;
  double d_q2_dX=0.0;
  double q1=0.0;
  double d_q1_dX=0.0;
  double Ic1ra=0.0;
  double d_Ic1ra_dX=0.0;
  double Ic0a=0.0;
  double d_Ic0a_dX=0.0;
  double TWO_Q=0.0;
  double FOUR_K=0.0;
  double Area=0.0;
  double d_Area_dX=0.0;
  double Tex=0.0;
  double d_Tex_dX=0.0;
  double TjK=0.0;
  double d_TjK_dX=0.0;
  double Tj=0.0;
  double d_Tj_dX=0.0;
  double Texi=0.0;
  double vcei=0.0;
  double d_vcei_dX=0.0;
  double vxxe=0.0;
  double d_vxxe_dX=0.0;
  double vxc=0.0;
  double d_vxc_dX=0.0;
  double vxe=0.0;
  double d_vxe_dX=0.0;
  double vbei=0.0;
  double d_vbei_dX=0.0;
  double vbci=0.0;
  double d_vbci_dX=0.0;
  double vbcx=0.0;
  double d_vbcx_dX=0.0;
  double tVCrit=0.0;
  double d_tVCrit_dX=0.0;


  // -- code converted from analog/code block
  {
    double value_log_0 = log((adms_vt_nom/(1.41421356237309504880*((((modelStruct.modelPar_Jsf*instanceStruct.instancePar_L)*instanceStruct.instancePar_W)*instanceStruct.instancePar_N)*1e12))));
    double  deriv_log_0_d0 = (1.0/(adms_vt_nom/(1.41421356237309504880*((((modelStruct.modelPar_Jsf*instanceStruct.instancePar_L)*instanceStruct.instancePar_W)*instanceStruct.instancePar_N)*1e12))));
    d_tVCrit_dX = adms_vt_nom*deriv_log_0_d0*((-adms_vt_nom*1.41421356237309504880*((modelStruct.modelPar_Jsf*instanceStruct.instancePar_L)*instanceStruct.d_instancePar_W_dX+(modelStruct.modelPar_Jsf*instanceStruct.d_instancePar_L_dX+modelStruct.d_modelPar_Jsf_dX*instanceStruct.instancePar_L)*instanceStruct.instancePar_W)*instanceStruct.instancePar_N*1e12/(1.41421356237309504880*((((modelStruct.modelPar_Jsf*instanceStruct.instancePar_L)*instanceStruct.instancePar_W)*instanceStruct.instancePar_N)*1e12))/(1.41421356237309504880*((((modelStruct.modelPar_Jsf*instanceStruct.instancePar_L)*instanceStruct.instancePar_W)*instanceStruct.instancePar_N)*1e12))));
    tVCrit = (adms_vt_nom*value_log_0);
  }
  vbcx = probeVars[admsProbeID_V_bi_ci];

  vbci = probeVars[admsProbeID_V_bii_ci];

  vbei = probeVars[admsProbeID_V_bii_ei];

  d_vxe_dX = 0.0;
  vxe = (modelStruct.modelPar_dtype*(probeVars[admsProbeID_V_ex_ei]));
  d_vxc_dX = 0.0;
  vxc = (modelStruct.modelPar_dtype*(probeVars[admsProbeID_V_cx_ci]));
  d_vxxe_dX = 0.0;
  vxxe = (modelStruct.modelPar_dtype*(probeVars[admsProbeID_V_exx_ei]));
  d_vcei_dX = 0.0;
  vcei = (modelStruct.modelPar_dtype*(probeVars[admsProbeID_V_ci_ei]));
  Texi = (probeVars[admsProbeID_V_ti_GND]);
  d_Tj_dX = instanceStruct.d_instancePar_Temp_dX;
  Tj = (Texi+instanceStruct.instancePar_Temp);
  d_TjK_dX = d_Tj_dX;
  TjK = (Tj+273.15);
  d_Tex_dX = (d_Tj_dX-modelStruct.d_modelPar_Tnom_dX);
  Tex = (Tj-modelStruct.modelPar_Tnom);
  d_Area_dX = (instanceStruct.instancePar_L*instanceStruct.d_instancePar_W_dX+instanceStruct.d_instancePar_L_dX*instanceStruct.instancePar_W)*1.0e12*instanceStruct.instancePar_N;
  Area = (((instanceStruct.instancePar_L*instanceStruct.instancePar_W)*1.0e12)*instanceStruct.instancePar_N);
  FOUR_K = (4*1.3806226e-23);
  TWO_Q = (2*1.6021918e-19);
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbei,modelStruct.modelPar_Jsf,modelStruct.modelPar_Vg,modelStruct.modelPar_nf,Area,Tj,modelStruct.modelPar_Tnom);
    d_Ic0a_dX = evaluator_diode_0.getDerivs(vbei,modelStruct.modelPar_Jsf,modelStruct.modelPar_Vg,modelStruct.modelPar_nf,Area,Tj,modelStruct.modelPar_Tnom,d_vbei_dX,modelStruct.d_modelPar_Jsf_dX,modelStruct.d_modelPar_Vg_dX,modelStruct.d_modelPar_nf_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX);
    Ic0a = evaluator_diode_0.getValues(vbei,modelStruct.modelPar_Jsf,modelStruct.modelPar_Vg,modelStruct.modelPar_nf,Area,Tj,modelStruct.modelPar_Tnom);
  }
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom);
    d_Ic1ra_dX = evaluator_diode_0.getDerivs(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom,d_vbci_dX,(modelStruct.modelPar_XCjc*modelStruct.d_modelPar_Jsr_dX+modelStruct.d_modelPar_XCjc_dX*modelStruct.modelPar_Jsr),modelStruct.d_modelPar_Vgr_dX,modelStruct.d_modelPar_nr_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX);
    Ic1ra = evaluator_diode_0.getValues(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom);
  }
  if (((modelStruct.modelPar_VAF>0.0)&&(modelStruct.modelPar_VAR>0.0)))
  {
    {
      AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_2(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0);
      AnalogFunctions::chargeEvaluator evaluator_charge_3(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0);
      d_q1_dX = (((modelStruct.modelPar_VAR*(evaluator_charge_0.getDerivs(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0,d_vbei_dX,0.0,modelStruct.d_modelPar_Vje_dX,modelStruct.d_modelPar_mje_dX,0.0)-evaluator_charge_1.getDerivs(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0,0.0,0.0,modelStruct.d_modelPar_Vje_dX,modelStruct.d_modelPar_mje_dX,0.0))-(evaluator_charge_0.getValues(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0))*modelStruct.d_modelPar_VAR_dX)/modelStruct.modelPar_VAR/modelStruct.modelPar_VAR)+((modelStruct.modelPar_VAF*(evaluator_charge_2.getDerivs(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0,d_vbci_dX,0.0,modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,0.0)-evaluator_charge_3.getDerivs(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0,0.0,0.0,modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,0.0))-(evaluator_charge_2.getValues(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0)-evaluator_charge_3.getValues(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0))*modelStruct.d_modelPar_VAF_dX)/modelStruct.modelPar_VAF/modelStruct.modelPar_VAF));
      q1 = ((1.0+((evaluator_charge_0.getValues(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0))/modelStruct.modelPar_VAR))+((evaluator_charge_2.getValues(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0)-evaluator_charge_3.getValues(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0))/modelStruct.modelPar_VAF));
    }
  }
  else
  {
    if (((modelStruct.modelPar_VAF>0.0)&&(modelStruct.modelPar_VAR==0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0);
        d_q1_dX = ((modelStruct.modelPar_VAF*(evaluator_charge_0.getDerivs(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0,d_vbci_dX,0.0,modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,0.0)-evaluator_charge_1.getDerivs(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0,0.0,0.0,modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,0.0))-(evaluator_charge_0.getValues(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0))*modelStruct.d_modelPar_VAF_dX)/modelStruct.modelPar_VAF/modelStruct.modelPar_VAF);
        q1 = (1.0+((evaluator_charge_0.getValues(vbci,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,1.0))/modelStruct.modelPar_VAF));
      }
    }
    else
    {
      if (((modelStruct.modelPar_VAF==0.0)&&(modelStruct.modelPar_VAR>0.0)))
      {
        {
          AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0);
          AnalogFunctions::chargeEvaluator evaluator_charge_1(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0);
          d_q1_dX = ((modelStruct.modelPar_VAR*(evaluator_charge_0.getDerivs(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0,d_vbei_dX,0.0,modelStruct.d_modelPar_Vje_dX,modelStruct.d_modelPar_mje_dX,0.0)-evaluator_charge_1.getDerivs(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0,0.0,0.0,modelStruct.d_modelPar_Vje_dX,modelStruct.d_modelPar_mje_dX,0.0))-(evaluator_charge_0.getValues(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0))*modelStruct.d_modelPar_VAR_dX)/modelStruct.modelPar_VAR/modelStruct.modelPar_VAR);
          q1 = (1.0+((evaluator_charge_0.getValues(vbei,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0)-evaluator_charge_1.getValues(0.0,1.0,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,1.0))/modelStruct.modelPar_VAR));
        }
      }
      else
      {
        d_q1_dX = 0.0;
        q1 = 1.0;
      }
    }
  }
  if (((modelStruct.modelPar_IKF>0.0)&&(modelStruct.modelPar_IKR>0.0)))
  {
    d_q2_dX = ((((Area*modelStruct.modelPar_IKF)*d_Ic0a_dX-Ic0a*(Area*modelStruct.d_modelPar_IKF_dX+d_Area_dX*modelStruct.modelPar_IKF))/(Area*modelStruct.modelPar_IKF)/(Area*modelStruct.modelPar_IKF))+(((Area*modelStruct.modelPar_IKR)*d_Ic1ra_dX-Ic1ra*(Area*modelStruct.d_modelPar_IKR_dX+d_Area_dX*modelStruct.modelPar_IKR))/(Area*modelStruct.modelPar_IKR)/(Area*modelStruct.modelPar_IKR)));
    q2 = ((Ic0a/(Area*modelStruct.modelPar_IKF))+(Ic1ra/(Area*modelStruct.modelPar_IKR)));
  }
  else
  {
    if (((modelStruct.modelPar_IKF>0.0)&&(modelStruct.modelPar_IKR==0.0)))
    {
      d_q2_dX = (((Area*modelStruct.modelPar_IKF)*d_Ic0a_dX-Ic0a*(Area*modelStruct.d_modelPar_IKF_dX+d_Area_dX*modelStruct.modelPar_IKF))/(Area*modelStruct.modelPar_IKF)/(Area*modelStruct.modelPar_IKF));
      q2 = (Ic0a/(Area*modelStruct.modelPar_IKF));
    }
    else
    {
      if (((modelStruct.modelPar_IKF==0.0)&&(modelStruct.modelPar_IKR>0.0)))
      {
        d_q2_dX = (((Area*modelStruct.modelPar_IKR)*d_Ic1ra_dX-Ic1ra*(Area*modelStruct.d_modelPar_IKR_dX+d_Area_dX*modelStruct.modelPar_IKR))/(Area*modelStruct.modelPar_IKR)/(Area*modelStruct.modelPar_IKR));
        q2 = (Ic1ra/(Area*modelStruct.modelPar_IKR));
      }
      else
      {
        d_q2_dX = 0.0;
        q2 = 0.0;
      }
    }
  }
  {
    double value_sqrt_0 = sqrt(((q1*q1)+(4.0*q2)));
    double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
    d_qb_dX = ((d_q1_dX+deriv_sqrt_0_d0*(((q1*d_q1_dX+d_q1_dX*q1)+4.0*d_q2_dX)))/2.0);
    qb = ((q1+value_sqrt_0)/2.0);
  }
  d_Ic0_dX = ((qb*d_Ic0a_dX-Ic0a*d_qb_dX)/qb/qb);
  Ic0 = (Ic0a/qb);
  d_Ic1r_dX = ((qb*d_Ic1ra_dX-Ic1ra*d_qb_dX)/qb/qb);
  Ic1r = (Ic1ra/qb);
  d_Ic1_dX = (d_Ic0_dX-d_Ic1r_dX);
  Ic1 = (Ic0-Ic1r);
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom);
    d_Ib2_dX = ((modelStruct.modelPar_Br*evaluator_diode_0.getDerivs(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom,d_vbci_dX,(modelStruct.modelPar_XCjc*modelStruct.d_modelPar_Jsr_dX+modelStruct.d_modelPar_XCjc_dX*modelStruct.modelPar_Jsr),modelStruct.d_modelPar_Vgr_dX,modelStruct.d_modelPar_nr_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX)-evaluator_diode_0.getValues(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom)*modelStruct.d_modelPar_Br_dX)/modelStruct.modelPar_Br/modelStruct.modelPar_Br);
    Ib2 = (evaluator_diode_0.getValues(vbci,(modelStruct.modelPar_XCjc*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom)/modelStruct.modelPar_Br);
  }
  {
    AnalogFunctions::diodeEvaluator evaluator_diode_0(vbcx,((1.0-modelStruct.modelPar_XCjc)*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom);
    d_Ibx_dX = ((modelStruct.modelPar_Br*evaluator_diode_0.getDerivs(vbcx,((1.0-modelStruct.modelPar_XCjc)*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom,d_vbcx_dX,((1.0-modelStruct.modelPar_XCjc)*modelStruct.d_modelPar_Jsr_dX+(-modelStruct.d_modelPar_XCjc_dX)*modelStruct.modelPar_Jsr),modelStruct.d_modelPar_Vgr_dX,modelStruct.d_modelPar_nr_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX)-evaluator_diode_0.getValues(vbcx,((1.0-modelStruct.modelPar_XCjc)*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom)*modelStruct.d_modelPar_Br_dX)/modelStruct.modelPar_Br/modelStruct.modelPar_Br);
    Ibx = (evaluator_diode_0.getValues(vbcx,((1.0-modelStruct.modelPar_XCjc)*modelStruct.modelPar_Jsr),modelStruct.modelPar_Vgr,modelStruct.modelPar_nr,Area,Tj,modelStruct.modelPar_Tnom)/modelStruct.modelPar_Br);
  }
  epsi = 1.0e-6;
  {
    double value_pow_0 = pow((1.0-epsi),(1/modelStruct.modelPar_Mc));
    double  deriv_pow_0_d1 = ((1.0-epsi) == 0.0)?0.0:(log((1.0-epsi))*value_pow_0);
    d_Vbclin_dX = (modelStruct.modelPar_BVceo*(deriv_pow_0_d1*((-1*modelStruct.d_modelPar_Mc_dX/modelStruct.modelPar_Mc/modelStruct.modelPar_Mc)))+modelStruct.d_modelPar_BVceo_dX*value_pow_0);
    Vbclin = (modelStruct.modelPar_BVceo*value_pow_0);
  }
  {
    AnalogFunctions::MMEvaluator evaluator_MM_0(vbci,modelStruct.modelPar_BVceo,modelStruct.modelPar_Mc,Vbclin,modelStruct.modelPar_Bf,modelStruct.modelPar_kc);
    d_mm_dX = evaluator_MM_0.getDerivs(vbci,modelStruct.modelPar_BVceo,modelStruct.modelPar_Mc,Vbclin,modelStruct.modelPar_Bf,modelStruct.modelPar_kc,d_vbci_dX,modelStruct.d_modelPar_BVceo_dX,modelStruct.d_modelPar_Mc_dX,d_Vbclin_dX,modelStruct.d_modelPar_Bf_dX,modelStruct.d_modelPar_kc_dX);
    mm = evaluator_MM_0.getValues(vbci,modelStruct.modelPar_BVceo,modelStruct.modelPar_Mc,Vbclin,modelStruct.modelPar_Bf,modelStruct.modelPar_kc);
  }
  if ((mm>1.0))
  {
    if ((modelStruct.modelPar_kBeta>0.0))
    {
      if (((modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex))>1e-6))
      {
        d_EdBeta_dX = ((((modelStruct.modelPar_kc*(mm-1))+1)*((-1*(modelStruct.d_modelPar_Bf_dX-(modelStruct.modelPar_kBeta*d_Tex_dX+modelStruct.d_modelPar_kBeta_dX*Tex))/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex))/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex)))-(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))-((1/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex)))-(modelStruct.modelPar_kc*(mm-1)))*(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1)/((modelStruct.modelPar_kc*(mm-1))+1));
        EdBeta = (((1/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex)))-(modelStruct.modelPar_kc*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1));
      }
      else
      {
        d_EdBeta_dX = ((((modelStruct.modelPar_kc*(mm-1))+1)*(-(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))-(1e6-(modelStruct.modelPar_kc*(mm-1)))*(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1)/((modelStruct.modelPar_kc*(mm-1))+1));
        EdBeta = ((1e6-(modelStruct.modelPar_kc*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1));
      }
    }
    else
    {
      d_EdBeta_dX = ((((modelStruct.modelPar_kc*(mm-1))+1)*((-1*modelStruct.d_modelPar_Bf_dX/modelStruct.modelPar_Bf/modelStruct.modelPar_Bf)-(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))-((1/modelStruct.modelPar_Bf)-(modelStruct.modelPar_kc*(mm-1)))*(modelStruct.modelPar_kc*d_mm_dX+modelStruct.d_modelPar_kc_dX*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1)/((modelStruct.modelPar_kc*(mm-1))+1));
      EdBeta = (((1/modelStruct.modelPar_Bf)-(modelStruct.modelPar_kc*(mm-1)))/((modelStruct.modelPar_kc*(mm-1))+1));
    }
  }
  else
  {
    if ((modelStruct.modelPar_kBeta>0.0))
    {
      if (((modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex))>1e-6))
      {
        d_EdBeta_dX = (-1*(modelStruct.d_modelPar_Bf_dX-(modelStruct.modelPar_kBeta*d_Tex_dX+modelStruct.d_modelPar_kBeta_dX*Tex))/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex))/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex)));
        EdBeta = (1/(modelStruct.modelPar_Bf-(modelStruct.modelPar_kBeta*Tex)));
      }
      else
      {
        d_EdBeta_dX = 0.0;
        EdBeta = 1e6;
      }
    }
    else
    {
      d_EdBeta_dX = (-1*modelStruct.d_modelPar_Bf_dX/modelStruct.modelPar_Bf/modelStruct.modelPar_Bf);
      EdBeta = (1/modelStruct.modelPar_Bf);
    }
  }
  d_Ib0_dX = (Ic0a*d_EdBeta_dX+d_Ic0a_dX*EdBeta);
  Ib0 = (Ic0a*EdBeta);
  if ((modelStruct.modelPar_BVebo>0))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(((-modelStruct.modelPar_BVebo)-vbei),modelStruct.modelPar_Jsf,0.0,1.0,Area,0.0,0.0);
      d_Ib1_dX = (d_Ib0_dX-evaluator_diode_0.getDerivs(((-modelStruct.modelPar_BVebo)-vbei),modelStruct.modelPar_Jsf,0.0,1.0,Area,0.0,0.0,((-modelStruct.d_modelPar_BVebo_dX)-d_vbei_dX),modelStruct.d_modelPar_Jsf_dX,0.0,0.0,d_Area_dX,0.0,0.0));
      Ib1 = (Ib0-evaluator_diode_0.getValues(((-modelStruct.modelPar_BVebo)-vbei),modelStruct.modelPar_Jsf,0.0,1.0,Area,0.0,0.0));
    }
  }
  else
  {
    d_Ib1_dX = d_Ib0_dX;
    Ib1 = Ib0;
  }
  if (((modelStruct.modelPar_Jse>0.0)&&(modelStruct.modelPar_ne>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxe,modelStruct.modelPar_Jse,modelStruct.modelPar_Vgb,modelStruct.modelPar_ne,Area,Tj,modelStruct.modelPar_Tnom);
      d_Ibdx_dX = evaluator_diode_0.getDerivs(vxe,modelStruct.modelPar_Jse,modelStruct.modelPar_Vgb,modelStruct.modelPar_ne,Area,Tj,modelStruct.modelPar_Tnom,d_vxe_dX,modelStruct.d_modelPar_Jse_dX,modelStruct.d_modelPar_Vgb_dX,modelStruct.d_modelPar_ne_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX);
      Ibdx = evaluator_diode_0.getValues(vxe,modelStruct.modelPar_Jse,modelStruct.modelPar_Vgb,modelStruct.modelPar_ne,Area,Tj,modelStruct.modelPar_Tnom);
    }
  }
  else
  {
    d_Ibdx_dX = d_vxe_dX*1e-12;
    Ibdx = (vxe*1e-12);
  }
  if (((modelStruct.modelPar_Jsee>0.0)&&(modelStruct.modelPar_nee>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxxe,modelStruct.modelPar_Jsee,modelStruct.modelPar_Vgbb,modelStruct.modelPar_nee,Area,Tj,modelStruct.modelPar_Tnom);
      d_Ibdxx_dX = evaluator_diode_0.getDerivs(vxxe,modelStruct.modelPar_Jsee,modelStruct.modelPar_Vgbb,modelStruct.modelPar_nee,Area,Tj,modelStruct.modelPar_Tnom,d_vxxe_dX,modelStruct.d_modelPar_Jsee_dX,modelStruct.d_modelPar_Vgbb_dX,modelStruct.d_modelPar_nee_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX);
      Ibdxx = evaluator_diode_0.getValues(vxxe,modelStruct.modelPar_Jsee,modelStruct.modelPar_Vgbb,modelStruct.modelPar_nee,Area,Tj,modelStruct.modelPar_Tnom);
    }
  }
  else
  {
    d_Ibdxx_dX = d_vxxe_dX*1e-12;
    Ibdxx = (vxxe*1e-12);
  }
  if (((modelStruct.modelPar_Jsc>0.0)&&(modelStruct.modelPar_nc>0)))
  {
    {
      AnalogFunctions::diodeEvaluator evaluator_diode_0(vxc,modelStruct.modelPar_Jsc,modelStruct.modelPar_Vgc,modelStruct.modelPar_nc,Area,Tj,modelStruct.modelPar_Tnom);
      d_Icdx_dX = evaluator_diode_0.getDerivs(vxc,modelStruct.modelPar_Jsc,modelStruct.modelPar_Vgc,modelStruct.modelPar_nc,Area,Tj,modelStruct.modelPar_Tnom,d_vxc_dX,modelStruct.d_modelPar_Jsc_dX,modelStruct.d_modelPar_Vgc_dX,modelStruct.d_modelPar_nc_dX,d_Area_dX,d_Tj_dX,modelStruct.d_modelPar_Tnom_dX);
      Icdx = evaluator_diode_0.getValues(vxc,modelStruct.modelPar_Jsc,modelStruct.modelPar_Vgc,modelStruct.modelPar_nc,Area,Tj,modelStruct.modelPar_Tnom);
    }
  }
  else
  {
    d_Icdx_dX = d_vxc_dX*1e-12;
    Icdx = (vxc*1e-12);
  }
  d_Ipdiss_dX = ((((Ic1*d_vcei_dX+d_Ic1_dX*vcei)+(Ib1*d_vbei_dX+d_Ib1_dX*vbei))+(Ib2*d_vbci_dX+d_Ib2_dX*vbci))+(Ibx*d_vbcx_dX+d_Ibx_dX*vbcx));
  Ipdiss = ((((Ic1*vcei)+(Ib1*vbei))+(Ib2*vbci))+(Ibx*vbcx));
  if ((Ipdiss<0.0))
  {
    d_Ipdiss_dX = 0.0;
    Ipdiss = 0;
  }
  d_I00_dX = (modelStruct.modelPar_J0*d_Area_dX+modelStruct.d_modelPar_J0_dX*Area);
  I00 = (modelStruct.modelPar_J0*Area);
  if (((modelStruct.modelPar_XCjc<1.0)&&(modelStruct.modelPar_XCjc>0.0)))
  {
    if (((modelStruct.modelPar_J0<=0.0)||(Ic0<0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area);
        d_qb2med_dX = ((modelStruct.modelPar_XCjc*evaluator_charge_0.getDerivs(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area,d_vbci_dX,(modelStruct.d_modelPar_Cjc_dX-modelStruct.d_modelPar_Cmin_dX),modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,d_Area_dX)+modelStruct.d_modelPar_XCjc_dX*evaluator_charge_0.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area))+(((modelStruct.modelPar_XCjc*Area)*modelStruct.modelPar_Cmin)*d_vbci_dX+((modelStruct.modelPar_XCjc*Area)*modelStruct.d_modelPar_Cmin_dX+(modelStruct.modelPar_XCjc*d_Area_dX+modelStruct.d_modelPar_XCjc_dX*Area)*modelStruct.modelPar_Cmin)*vbci));
        qb2med = ((modelStruct.modelPar_XCjc*evaluator_charge_0.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area))+(((modelStruct.modelPar_XCjc*Area)*modelStruct.modelPar_Cmin)*vbci));
      }
    }
    else
    {
      d_xix_dX = ((I00*d_Ic0_dX-Ic0*d_I00_dX)/I00/I00);
      xix = (Ic0/I00);
      {
        double value_tanh_0 = tanh(xix);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area);
        double  deriv_tanh_0_d0 = (1.0/cosh(xix)/cosh(xix));
        d_qb2med_dX = (((modelStruct.modelPar_XCjc*(1.0-value_tanh_0))*(evaluator_charge_1.getDerivs(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area,d_vbci_dX,(modelStruct.d_modelPar_Cjc_dX-modelStruct.d_modelPar_Cmin_dX),modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,d_Area_dX)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*d_vbci_dX+(((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.d_modelPar_Cmin_dX+((1.0-modelStruct.modelPar_XJ0)*d_Area_dX+(-modelStruct.d_modelPar_XJ0_dX)*Area)*modelStruct.modelPar_Cmin)*vbci))+(modelStruct.modelPar_XCjc*(-deriv_tanh_0_d0*(d_xix_dX))+modelStruct.d_modelPar_XCjc_dX*(1.0-value_tanh_0))*(evaluator_charge_1.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*vbci)))+((((modelStruct.modelPar_XJ0*modelStruct.modelPar_XCjc)*Area)*modelStruct.modelPar_Cmin)*d_vbci_dX+(((modelStruct.modelPar_XJ0*modelStruct.modelPar_XCjc)*Area)*modelStruct.d_modelPar_Cmin_dX+((modelStruct.modelPar_XJ0*modelStruct.modelPar_XCjc)*d_Area_dX+(modelStruct.modelPar_XJ0*modelStruct.d_modelPar_XCjc_dX+modelStruct.d_modelPar_XJ0_dX*modelStruct.modelPar_XCjc)*Area)*modelStruct.modelPar_Cmin)*vbci));
        qb2med = (((modelStruct.modelPar_XCjc*(1.0-value_tanh_0))*(evaluator_charge_1.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*vbci)))+((((modelStruct.modelPar_XJ0*modelStruct.modelPar_XCjc)*Area)*modelStruct.modelPar_Cmin)*vbci));
      }
    }
  }
  else
  {
    if (((modelStruct.modelPar_J0<0.0)||(Ic0<0.0)))
    {
      {
        AnalogFunctions::chargeEvaluator evaluator_charge_0(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area);
        d_qb2med_dX = (evaluator_charge_0.getDerivs(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area,d_vbci_dX,(modelStruct.d_modelPar_Cjc_dX-modelStruct.d_modelPar_Cmin_dX),modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,d_Area_dX)+((Area*modelStruct.modelPar_Cmin)*d_vbci_dX+(Area*modelStruct.d_modelPar_Cmin_dX+d_Area_dX*modelStruct.modelPar_Cmin)*vbci));
        qb2med = (evaluator_charge_0.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area)+((Area*modelStruct.modelPar_Cmin)*vbci));
      }
    }
    else
    {
      d_xix_dX = ((I00*d_Ic0_dX-Ic0*d_I00_dX)/I00/I00);
      xix = (Ic0/I00);
      {
        double value_tanh_0 = tanh(xix);
        AnalogFunctions::chargeEvaluator evaluator_charge_1(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area);
        double  deriv_tanh_0_d0 = (1.0/cosh(xix)/cosh(xix));
        d_qb2med_dX = (((1.0-value_tanh_0)*(evaluator_charge_1.getDerivs(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area,d_vbci_dX,(modelStruct.d_modelPar_Cjc_dX-modelStruct.d_modelPar_Cmin_dX),modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,d_Area_dX)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*d_vbci_dX+(((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.d_modelPar_Cmin_dX+((1.0-modelStruct.modelPar_XJ0)*d_Area_dX+(-modelStruct.d_modelPar_XJ0_dX)*Area)*modelStruct.modelPar_Cmin)*vbci))+(-deriv_tanh_0_d0*(d_xix_dX))*(evaluator_charge_1.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*vbci)))+(((modelStruct.modelPar_XJ0*Area)*modelStruct.modelPar_Cmin)*d_vbci_dX+((modelStruct.modelPar_XJ0*Area)*modelStruct.d_modelPar_Cmin_dX+(modelStruct.modelPar_XJ0*d_Area_dX+modelStruct.d_modelPar_XJ0_dX*Area)*modelStruct.modelPar_Cmin)*vbci));
        qb2med = (((1.0-value_tanh_0)*(evaluator_charge_1.getValues(vbci,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area)+((((1.0-modelStruct.modelPar_XJ0)*Area)*modelStruct.modelPar_Cmin)*vbci)))+(((modelStruct.modelPar_XJ0*Area)*modelStruct.modelPar_Cmin)*vbci));
      }
    }
  }
  if (((modelStruct.modelPar_XCjc<1.0)&&(modelStruct.modelPar_XCjc>0.0)))
  {
    {
      AnalogFunctions::chargeEvaluator evaluator_charge_0(vbcx,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area);
      d_qb1_dX = (((1.0-modelStruct.modelPar_XCjc)*evaluator_charge_0.getDerivs(vbcx,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area,d_vbcx_dX,(modelStruct.d_modelPar_Cjc_dX-modelStruct.d_modelPar_Cmin_dX),modelStruct.d_modelPar_Vjc_dX,modelStruct.d_modelPar_mjc_dX,d_Area_dX)+(-modelStruct.d_modelPar_XCjc_dX)*evaluator_charge_0.getValues(vbcx,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area))+((((1.0-modelStruct.modelPar_XCjc)*Area)*modelStruct.modelPar_Cmin)*d_vbcx_dX+(((1.0-modelStruct.modelPar_XCjc)*Area)*modelStruct.d_modelPar_Cmin_dX+((1.0-modelStruct.modelPar_XCjc)*d_Area_dX+(-modelStruct.d_modelPar_XCjc_dX)*Area)*modelStruct.modelPar_Cmin)*vbcx));
      qb1 = (((1.0-modelStruct.modelPar_XCjc)*evaluator_charge_0.getValues(vbcx,(modelStruct.modelPar_Cjc-modelStruct.modelPar_Cmin),modelStruct.modelPar_Vjc,modelStruct.modelPar_mjc,Area))+((((1.0-modelStruct.modelPar_XCjc)*Area)*modelStruct.modelPar_Cmin)*vbcx));
    }
  }
  else
  {
    d_qb1_dX = 0.0;
    qb1 = 0.0;
  }
  d_qbtr_dX = (modelStruct.modelPar_Tr*d_Ic1r_dX+modelStruct.d_modelPar_Tr_dX*Ic1r);
  qbtr = (modelStruct.modelPar_Tr*Ic1r);
  d_qbtra_dX = (modelStruct.modelPar_Trx*d_Ibx_dX+modelStruct.d_modelPar_Trx_dX*Ibx);
  qbtra = (modelStruct.modelPar_Trx*Ibx);
  d_qb2_dX = (d_qb2med_dX+d_qbtr_dX);
  qb2 = (qb2med+qbtr);
  if (((modelStruct.modelPar_Jk>0.0)&&(modelStruct.modelPar_Rci0>0.0)))
  {
    if ((modelStruct.modelPar_RJk>0.0))
    {
      d_Vlim_dX = (((1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk))*(modelStruct.modelPar_Jk*modelStruct.d_modelPar_Rci0_dX+modelStruct.d_modelPar_Jk_dX*modelStruct.modelPar_Rci0)-(modelStruct.modelPar_Jk*modelStruct.modelPar_Rci0)*(-((modelStruct.modelPar_RJk*modelStruct.d_modelPar_Rci0_dX-modelStruct.modelPar_Rci0*modelStruct.d_modelPar_RJk_dX)/modelStruct.modelPar_RJk/modelStruct.modelPar_RJk)))/(1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk))/(1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk)));
      Vlim = ((modelStruct.modelPar_Jk*modelStruct.modelPar_Rci0)/(1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk)));
      d_InvVpt_dX = (((modelStruct.modelPar_Jk*modelStruct.modelPar_RJk)*(-((modelStruct.modelPar_RJk*modelStruct.d_modelPar_Rci0_dX-modelStruct.modelPar_Rci0*modelStruct.d_modelPar_RJk_dX)/modelStruct.modelPar_RJk/modelStruct.modelPar_RJk))-(1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk))*(modelStruct.modelPar_Jk*modelStruct.d_modelPar_RJk_dX+modelStruct.d_modelPar_Jk_dX*modelStruct.modelPar_RJk))/(modelStruct.modelPar_Jk*modelStruct.modelPar_RJk)/(modelStruct.modelPar_Jk*modelStruct.modelPar_RJk));
      InvVpt = ((1.0-(modelStruct.modelPar_Rci0/modelStruct.modelPar_RJk))/(modelStruct.modelPar_Jk*modelStruct.modelPar_RJk));
    }
    else
    {
      d_Vlim_dX = ((modelStruct.modelPar_Jk*modelStruct.d_modelPar_Rci0_dX+modelStruct.d_modelPar_Jk_dX*modelStruct.modelPar_Rci0)/1.016);
      Vlim = ((modelStruct.modelPar_Jk*modelStruct.modelPar_Rci0)/1.016);
      d_InvVpt_dX = 0.0;
      InvVpt = 0.0;
    }
  }
  if (((((modelStruct.modelPar_Thcs>0.0)&&(modelStruct.modelPar_Ahc>0.0))&&(modelStruct.modelPar_Jk>0.0))&&(Ic0>0.0)))
  {
    d_RCIO_dX = ((Area*modelStruct.d_modelPar_Rci0_dX-modelStruct.modelPar_Rci0*d_Area_dX)/Area/Area);
    RCIO = (modelStruct.modelPar_Rci0/Area);
    d_AHC_dX = (Area*modelStruct.d_modelPar_Ahc_dX+d_Area_dX*modelStruct.modelPar_Ahc);
    AHC = (Area*modelStruct.modelPar_Ahc);
    if (((modelStruct.modelPar_Rci0<modelStruct.modelPar_RJk)||(modelStruct.modelPar_RJk<=0.0)))
    {
      {
        AnalogFunctions::ICKEvaluator evaluator_ICK_0(vcei,RCIO,Vlim,InvVpt,modelStruct.modelPar_Vces);
        d_Ih_dX = (-((Ic0*evaluator_ICK_0.getDerivs(vcei,RCIO,Vlim,InvVpt,modelStruct.modelPar_Vces,d_vcei_dX,d_RCIO_dX,d_Vlim_dX,d_InvVpt_dX,modelStruct.d_modelPar_Vces_dX)-evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,modelStruct.modelPar_Vces)*d_Ic0_dX)/Ic0/Ic0));
        Ih = (1.0-(evaluator_ICK_0.getValues(vcei,RCIO,Vlim,InvVpt,modelStruct.modelPar_Vces)/Ic0));
      }
    }
    else
    {
      {
        AnalogFunctions::VceffEvaluator evaluator_Vceff_0(vcei,modelStruct.modelPar_Vces);
        d_Ih_dX = (-(((RCIO*Ic0)*evaluator_Vceff_0.getDerivs(vcei,modelStruct.modelPar_Vces,d_vcei_dX,modelStruct.d_modelPar_Vces_dX)-evaluator_Vceff_0.getValues(vcei,modelStruct.modelPar_Vces)*(RCIO*d_Ic0_dX+d_RCIO_dX*Ic0))/(RCIO*Ic0)/(RCIO*Ic0)));
        Ih = (1.0-(evaluator_Vceff_0.getValues(vcei,modelStruct.modelPar_Vces)/(RCIO*Ic0)));
      }
    }
    {
      double value_sqrt_0 = sqrt(((Ih*Ih)+AHC));
      double value_sqrt_1 = sqrt((1.0+AHC));
      double  deriv_sqrt_0_d0 = (0.5/value_sqrt_0);
      double  deriv_sqrt_1_d0 = (0.5/value_sqrt_1);
      d_Wh_dX = (((1.0+value_sqrt_1)*(d_Ih_dX+deriv_sqrt_0_d0*(((Ih*d_Ih_dX+d_Ih_dX*Ih)+d_AHC_dX)))-(Ih+value_sqrt_0)*deriv_sqrt_1_d0*(d_AHC_dX))/(1.0+value_sqrt_1)/(1.0+value_sqrt_1));
      Wh = ((Ih+value_sqrt_0)/(1.0+value_sqrt_1));
    }
    d_xtff_dX = ((modelStruct.modelPar_Thcs*Ic0)*(Wh*d_Wh_dX+d_Wh_dX*Wh)+(modelStruct.modelPar_Thcs*d_Ic0_dX+modelStruct.d_modelPar_Thcs_dX*Ic0)*(Wh*Wh));
    xtff = ((modelStruct.modelPar_Thcs*Ic0)*(Wh*Wh));
  }
  else
  {
    d_xtff_dX = 0.0;
    xtff = 0;
  }
  d_qbtf_dX = ((modelStruct.modelPar_Tf+(modelStruct.modelPar_Tft*Tex))*d_Ic0_dX+(modelStruct.d_modelPar_Tf_dX+(modelStruct.modelPar_Tft*d_Tex_dX+modelStruct.d_modelPar_Tft_dX*Tex))*Ic0);
  qbtf = ((modelStruct.modelPar_Tf+(modelStruct.modelPar_Tft*Tex))*Ic0);
  {
    AnalogFunctions::chargeEvaluator evaluator_charge_0(vbei,modelStruct.modelPar_Cje,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,Area);
    d_qbe_dX = ((d_xtff_dX+d_qbtf_dX)+evaluator_charge_0.getDerivs(vbei,modelStruct.modelPar_Cje,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,Area,d_vbei_dX,modelStruct.d_modelPar_Cje_dX,modelStruct.d_modelPar_Vje_dX,modelStruct.d_modelPar_mje_dX,d_Area_dX));
    qbe = ((xtff+qbtf)+evaluator_charge_0.getValues(vbei,modelStruct.modelPar_Cje,modelStruct.modelPar_Vje,modelStruct.modelPar_mje,Area));
  }
  // I(bi,ci) <+ ((dtype*Ibx))
  d_staticContributions_dX[admsNodeID_bi]+= modelStruct.modelPar_dtype*d_Ibx_dX;
  d_staticContributions_dX[(admsNodeID_ci)]-= modelStruct.modelPar_dtype*d_Ibx_dX;
  // I(bi,ci) <+ ((dtype*ddt((qb1+qbtra))))
  d_dynamicContributions_dX[admsNodeID_bi]+= modelStruct.modelPar_dtype*((d_qb1_dX+d_qbtra_dX));
  d_dynamicContributions_dX[(admsNodeID_ci)]-= modelStruct.modelPar_dtype*((d_qb1_dX+d_qbtra_dX));
  // I(bii,ci) <+ ((dtype*Ib2))
  d_staticContributions_dX[admsNodeID_bii]+= modelStruct.modelPar_dtype*d_Ib2_dX;
  d_staticContributions_dX[(admsNodeID_ci)]-= modelStruct.modelPar_dtype*d_Ib2_dX;
  // I(bii,ci) <+ ((dtype*ddt(qb2)))
  d_dynamicContributions_dX[admsNodeID_bii]+= modelStruct.modelPar_dtype*(d_qb2_dX);
  d_dynamicContributions_dX[(admsNodeID_ci)]-= modelStruct.modelPar_dtype*(d_qb2_dX);
  // I(bii,ei) <+ ((dtype*Ib1))
  d_staticContributions_dX[admsNodeID_bii]+= modelStruct.modelPar_dtype*d_Ib1_dX;
  d_staticContributions_dX[(admsNodeID_ei)]-= modelStruct.modelPar_dtype*d_Ib1_dX;
  // I(bii,ei) <+ ((dtype*ddt(qbe)))
  d_dynamicContributions_dX[admsNodeID_bii]+= modelStruct.modelPar_dtype*(d_qbe_dX);
  d_dynamicContributions_dX[(admsNodeID_ei)]-= modelStruct.modelPar_dtype*(d_qbe_dX);
  // I(ci,ei) <+ ((dtype*Ic1))
  d_staticContributions_dX[admsNodeID_ci]+= modelStruct.modelPar_dtype*d_Ic1_dX;
  d_staticContributions_dX[(admsNodeID_ei)]-= modelStruct.modelPar_dtype*d_Ic1_dX;
  // I(ex,ei) <+ ((dtype*Ibdx))
  d_staticContributions_dX[admsNodeID_ex]+= modelStruct.modelPar_dtype*d_Ibdx_dX;
  d_staticContributions_dX[(admsNodeID_ei)]-= modelStruct.modelPar_dtype*d_Ibdx_dX;
  // I(exx,ei) <+ ((dtype*Ibdxx))
  d_staticContributions_dX[admsNodeID_exx]+= modelStruct.modelPar_dtype*d_Ibdxx_dX;
  d_staticContributions_dX[(admsNodeID_ei)]-= modelStruct.modelPar_dtype*d_Ibdxx_dX;
  // I(cx,ci) <+ ((dtype*Icdx))
  d_staticContributions_dX[admsNodeID_cx]+= modelStruct.modelPar_dtype*d_Icdx_dX;
  d_staticContributions_dX[(admsNodeID_ci)]-= modelStruct.modelPar_dtype*d_Icdx_dX;
  // V(b,bi) <+ ((I(b,bi)*(Rb/N)))
  d_staticContributions_dX[admsBRA_ID_b_bi] += (probeVars[admsProbeID_I_b_bi])*(modelStruct.d_modelPar_Rb_dX/instanceStruct.instancePar_N);
  // V(b,bi) <+ (ddt((I(b,bi)*Lb)))
  d_dynamicContributions_dX[admsBRA_ID_b_bi] += ((probeVars[admsProbeID_I_b_bi])*modelStruct.d_modelPar_Lb_dX);
  // V(e,ei) <+ ((I(e,ei)*(Re/N)))
  d_staticContributions_dX[admsBRA_ID_e_ei] += (probeVars[admsProbeID_I_e_ei])*(modelStruct.d_modelPar_Re_dX/instanceStruct.instancePar_N);
  // V(e,ei) <+ (ddt((I(e,ei)*Le)))
  d_dynamicContributions_dX[admsBRA_ID_e_ei] += ((probeVars[admsProbeID_I_e_ei])*modelStruct.d_modelPar_Le_dX);
  // V(c,ci) <+ ((I(c,ci)*(Rc/N)))
  d_staticContributions_dX[admsBRA_ID_c_ci] += (probeVars[admsProbeID_I_c_ci])*(modelStruct.d_modelPar_Rc_dX/instanceStruct.instancePar_N);
  // V(c,ci) <+ (ddt((I(c,ci)*Lc)))
  d_dynamicContributions_dX[admsBRA_ID_c_ci] += ((probeVars[admsProbeID_I_c_ci])*modelStruct.d_modelPar_Lc_dX);
  // I(bii,bi) <+ ((V(bii,bi)/(Rb2/N)))
  d_staticContributions_dX[admsNodeID_bii]+= (-(probeVars[admsProbeID_V_bii_bi])*(modelStruct.d_modelPar_Rb2_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rb2/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rb2/instanceStruct.instancePar_N));
  d_staticContributions_dX[(admsNodeID_bi)]-= (-(probeVars[admsProbeID_V_bii_bi])*(modelStruct.d_modelPar_Rb2_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rb2/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rb2/instanceStruct.instancePar_N));
  if (((modelStruct.modelPar_Jse>0.0)&&(modelStruct.modelPar_ne>0)))
  {
    // I(ex,bii) <+ ((V(ex,bii)/(Rbxx/N)))
    d_staticContributions_dX[admsNodeID_ex]+= (-(probeVars[admsProbeID_V_ex_bii])*(modelStruct.d_modelPar_Rbxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbxx/instanceStruct.instancePar_N));
    d_staticContributions_dX[(admsNodeID_bii)]-= (-(probeVars[admsProbeID_V_ex_bii])*(modelStruct.d_modelPar_Rbxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbxx/instanceStruct.instancePar_N));
  }
  else
  {
    // I(ex,bii) <+ ((V(ex,bii)*1e-12))
    d_staticContributions_dX[admsNodeID_ex]+= 0.0;
    d_staticContributions_dX[(admsNodeID_bii)]-= 0.0;
  }
  if (((modelStruct.modelPar_Jsee>0.0)&&(modelStruct.modelPar_nee>0)))
  {
    // I(exx,bii) <+ ((V(exx,bii)/(Rbbxx/N)))
    d_staticContributions_dX[admsNodeID_exx]+= (-(probeVars[admsProbeID_V_exx_bii])*(modelStruct.d_modelPar_Rbbxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbbxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbbxx/instanceStruct.instancePar_N));
    d_staticContributions_dX[(admsNodeID_bii)]-= (-(probeVars[admsProbeID_V_exx_bii])*(modelStruct.d_modelPar_Rbbxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbbxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rbbxx/instanceStruct.instancePar_N));
  }
  else
  {
    // I(exx,bii) <+ ((V(exx,bii)*1e-12))
    d_staticContributions_dX[admsNodeID_exx]+= 0.0;
    d_staticContributions_dX[(admsNodeID_bii)]-= 0.0;
  }
  if (((modelStruct.modelPar_Jsc>0.0)&&(modelStruct.modelPar_nc>0)))
  {
    // I(cx,bii) <+ ((V(cx,bii)/(Rcxx/N)))
    d_staticContributions_dX[admsNodeID_cx]+= (-(probeVars[admsProbeID_V_cx_bii])*(modelStruct.d_modelPar_Rcxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rcxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rcxx/instanceStruct.instancePar_N));
    d_staticContributions_dX[(admsNodeID_bii)]-= (-(probeVars[admsProbeID_V_cx_bii])*(modelStruct.d_modelPar_Rcxx_dX/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rcxx/instanceStruct.instancePar_N)/(modelStruct.modelPar_Rcxx/instanceStruct.instancePar_N));
  }
  else
  {
    // I(cx,bii) <+ ((V(cx,bii)*1e-12))
    d_staticContributions_dX[admsNodeID_cx]+= 0.0;
    d_staticContributions_dX[(admsNodeID_bii)]-= 0.0;
  }
  // I(b,GND) <+ (ddt((Cpb*V(b,GND))))
  d_dynamicContributions_dX[admsNodeID_b]+= (modelStruct.d_modelPar_Cpb_dX*(probeVars[admsProbeID_V_b_GND]));
  // I(c,GND) <+ (ddt((Cpc*V(c,GND))))
  d_dynamicContributions_dX[admsNodeID_c]+= (modelStruct.d_modelPar_Cpc_dX*(probeVars[admsProbeID_V_c_GND]));
  // I(b,c) <+ (ddt((Cq*V(b,c))))
  d_dynamicContributions_dX[admsNodeID_b]+= (modelStruct.d_modelPar_Cq_dX*(probeVars[admsProbeID_V_b_c]));
  d_dynamicContributions_dX[(admsNodeID_c)]-= (modelStruct.d_modelPar_Cq_dX*(probeVars[admsProbeID_V_b_c]));
  // I(ti,GND) <+ ((-Ipdiss))
  d_staticContributions_dX[admsNodeID_ti]+= (-d_Ipdiss_dX);
  if ((modelStruct.modelPar_Rth>0))
  {
    // I(t,ti) <+ ((V(t,ti)/Rth))
    d_staticContributions_dX[admsNodeID_t]+= (-(probeVars[admsProbeID_V_t_ti])*modelStruct.d_modelPar_Rth_dX/modelStruct.modelPar_Rth/modelStruct.modelPar_Rth);
    d_staticContributions_dX[(admsNodeID_ti)]-= (-(probeVars[admsProbeID_V_t_ti])*modelStruct.d_modelPar_Rth_dX/modelStruct.modelPar_Rth/modelStruct.modelPar_Rth);
    // I(t,ti) <+ ((Cth*ddt(V(t,ti))))
    d_dynamicContributions_dX[admsNodeID_t]+= modelStruct.d_modelPar_Cth_dX*((probeVars[admsProbeID_V_t_ti]));
    d_dynamicContributions_dX[(admsNodeID_ti)]-= modelStruct.d_modelPar_Cth_dX*((probeVars[admsProbeID_V_t_ti]));
  }
  else
  {
    // I(t,ti) <+ ((V(t,ti)*1e3))
    d_staticContributions_dX[admsNodeID_t]+= 0.0;
    d_staticContributions_dX[(admsNodeID_ti)]-= 0.0;
  }
}



//-----------------------------------------------------------------------------
// Function      : InstanceSensitivity::operator()
// Purpose       : return sensitivity for a single instance parameter
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
/// Compute sensitivity of a device instance's outputs to a specified instance
/// parameter
///
///
/// @param[in] entity  The device entity that owns the parameter
/// @param[in] name    The unadorned parameter name specific to the entity
/// @param[out] dfdp   The derivative of the F vector with respect to the parameter
/// @param[out] dqdp   The derivative of the Q vector with respect to the parameter
/// @param[out] dbdp   The derivative of the B vector with respect to the parameter
/// @param[out] Findices   The indices into the F vector corresponding to the elements of dfdp
/// @param[out] Qindices   The indices into the Q vector corresponding to the elements of dfdp
/// @param[out] Bindices   The indices into the B vector corresponding to the elements of dfdp
///
///
void InstanceSensitivity::operator()
  (
     const ParameterBase &entity,
     const std::string &name,
     std::vector<double> & dfdp,
     std::vector<double> & dqdp,
     std::vector<double> & dbdp,
     std::vector<int> & Findices,
     std::vector<int> & Qindices,
     std::vector<int> & Bindices
   ) const
{
  const ParameterBase * e1 = &entity;
  const Instance & in = *(dynamic_cast<const Instance *> (e1));
  const Model & mod =in.model_;

  dfdp.resize(12+3);
  dqdp.resize(12+3);
  Findices.resize(12+3);
  Qindices.resize(12+3);

  std::vector <double> probeVars(19);
  std::vector <double> d_staticContributions_dX(12+3);
  std::vector <double> d_dynamicContributions_dX(12+3);


  // initialize contributions to zero (automatically sets derivatives to zero)
  for (int i=0; i < 12+3 ; ++i)
  {
    d_staticContributions_dX[i]=0;
    d_dynamicContributions_dX[i]=0;
  }

  // Copy out all the model parameters (doubles) into local structure
  modelSensStruct modelStruct;

  //reals
  modelStruct.modelPar_Temp=mod.Temp;
  modelStruct.d_modelPar_Temp_dX=0.0;
  modelStruct.modelPar_given_Temp=mod.given("Temp");
  modelStruct.modelPar_Rth=mod.Rth;
  modelStruct.d_modelPar_Rth_dX=0.0;
  modelStruct.modelPar_given_Rth=mod.given("Rth");
  modelStruct.modelPar_Cth=mod.Cth;
  modelStruct.d_modelPar_Cth_dX=0.0;
  modelStruct.modelPar_given_Cth=mod.given("Cth");
  modelStruct.modelPar_L=mod.L;
  modelStruct.d_modelPar_L_dX=0.0;
  modelStruct.modelPar_given_L=mod.given("L");
  modelStruct.modelPar_W=mod.W;
  modelStruct.d_modelPar_W_dX=0.0;
  modelStruct.modelPar_given_W=mod.given("W");
  modelStruct.modelPar_Jsf=mod.Jsf;
  modelStruct.d_modelPar_Jsf_dX=0.0;
  modelStruct.modelPar_given_Jsf=mod.given("Jsf");
  modelStruct.modelPar_nf=mod.nf;
  modelStruct.d_modelPar_nf_dX=0.0;
  modelStruct.modelPar_given_nf=mod.given("nf");
  modelStruct.modelPar_Vg=mod.Vg;
  modelStruct.d_modelPar_Vg_dX=0.0;
  modelStruct.modelPar_given_Vg=mod.given("Vg");
  modelStruct.modelPar_Jse=mod.Jse;
  modelStruct.d_modelPar_Jse_dX=0.0;
  modelStruct.modelPar_given_Jse=mod.given("Jse");
  modelStruct.modelPar_ne=mod.ne;
  modelStruct.d_modelPar_ne_dX=0.0;
  modelStruct.modelPar_given_ne=mod.given("ne");
  modelStruct.modelPar_Rbxx=mod.Rbxx;
  modelStruct.d_modelPar_Rbxx_dX=0.0;
  modelStruct.modelPar_given_Rbxx=mod.given("Rbxx");
  modelStruct.modelPar_Vgb=mod.Vgb;
  modelStruct.d_modelPar_Vgb_dX=0.0;
  modelStruct.modelPar_given_Vgb=mod.given("Vgb");
  modelStruct.modelPar_Jsee=mod.Jsee;
  modelStruct.d_modelPar_Jsee_dX=0.0;
  modelStruct.modelPar_given_Jsee=mod.given("Jsee");
  modelStruct.modelPar_nee=mod.nee;
  modelStruct.d_modelPar_nee_dX=0.0;
  modelStruct.modelPar_given_nee=mod.given("nee");
  modelStruct.modelPar_Rbbxx=mod.Rbbxx;
  modelStruct.d_modelPar_Rbbxx_dX=0.0;
  modelStruct.modelPar_given_Rbbxx=mod.given("Rbbxx");
  modelStruct.modelPar_Vgbb=mod.Vgbb;
  modelStruct.d_modelPar_Vgbb_dX=0.0;
  modelStruct.modelPar_given_Vgbb=mod.given("Vgbb");
  modelStruct.modelPar_Jsr=mod.Jsr;
  modelStruct.d_modelPar_Jsr_dX=0.0;
  modelStruct.modelPar_given_Jsr=mod.given("Jsr");
  modelStruct.modelPar_nr=mod.nr;
  modelStruct.d_modelPar_nr_dX=0.0;
  modelStruct.modelPar_given_nr=mod.given("nr");
  modelStruct.modelPar_Vgr=mod.Vgr;
  modelStruct.d_modelPar_Vgr_dX=0.0;
  modelStruct.modelPar_given_Vgr=mod.given("Vgr");
  modelStruct.modelPar_XCjc=mod.XCjc;
  modelStruct.d_modelPar_XCjc_dX=0.0;
  modelStruct.modelPar_given_XCjc=mod.given("XCjc");
  modelStruct.modelPar_Jsc=mod.Jsc;
  modelStruct.d_modelPar_Jsc_dX=0.0;
  modelStruct.modelPar_given_Jsc=mod.given("Jsc");
  modelStruct.modelPar_nc=mod.nc;
  modelStruct.d_modelPar_nc_dX=0.0;
  modelStruct.modelPar_given_nc=mod.given("nc");
  modelStruct.modelPar_Rcxx=mod.Rcxx;
  modelStruct.d_modelPar_Rcxx_dX=0.0;
  modelStruct.modelPar_given_Rcxx=mod.given("Rcxx");
  modelStruct.modelPar_Vgc=mod.Vgc;
  modelStruct.d_modelPar_Vgc_dX=0.0;
  modelStruct.modelPar_given_Vgc=mod.given("Vgc");
  modelStruct.modelPar_Bf=mod.Bf;
  modelStruct.d_modelPar_Bf_dX=0.0;
  modelStruct.modelPar_given_Bf=mod.given("Bf");
  modelStruct.modelPar_kBeta=mod.kBeta;
  modelStruct.d_modelPar_kBeta_dX=0.0;
  modelStruct.modelPar_given_kBeta=mod.given("kBeta");
  modelStruct.modelPar_Br=mod.Br;
  modelStruct.d_modelPar_Br_dX=0.0;
  modelStruct.modelPar_given_Br=mod.given("Br");
  modelStruct.modelPar_VAF=mod.VAF;
  modelStruct.d_modelPar_VAF_dX=0.0;
  modelStruct.modelPar_given_VAF=mod.given("VAF");
  modelStruct.modelPar_VAR=mod.VAR;
  modelStruct.d_modelPar_VAR_dX=0.0;
  modelStruct.modelPar_given_VAR=mod.given("VAR");
  modelStruct.modelPar_IKF=mod.IKF;
  modelStruct.d_modelPar_IKF_dX=0.0;
  modelStruct.modelPar_given_IKF=mod.given("IKF");
  modelStruct.modelPar_IKR=mod.IKR;
  modelStruct.d_modelPar_IKR_dX=0.0;
  modelStruct.modelPar_given_IKR=mod.given("IKR");
  modelStruct.modelPar_Mc=mod.Mc;
  modelStruct.d_modelPar_Mc_dX=0.0;
  modelStruct.modelPar_given_Mc=mod.given("Mc");
  modelStruct.modelPar_BVceo=mod.BVceo;
  modelStruct.d_modelPar_BVceo_dX=0.0;
  modelStruct.modelPar_given_BVceo=mod.given("BVceo");
  modelStruct.modelPar_kc=mod.kc;
  modelStruct.d_modelPar_kc_dX=0.0;
  modelStruct.modelPar_given_kc=mod.given("kc");
  modelStruct.modelPar_BVebo=mod.BVebo;
  modelStruct.d_modelPar_BVebo_dX=0.0;
  modelStruct.modelPar_given_BVebo=mod.given("BVebo");
  modelStruct.modelPar_Tr=mod.Tr;
  modelStruct.d_modelPar_Tr_dX=0.0;
  modelStruct.modelPar_given_Tr=mod.given("Tr");
  modelStruct.modelPar_Trx=mod.Trx;
  modelStruct.d_modelPar_Trx_dX=0.0;
  modelStruct.modelPar_given_Trx=mod.given("Trx");
  modelStruct.modelPar_Tf=mod.Tf;
  modelStruct.d_modelPar_Tf_dX=0.0;
  modelStruct.modelPar_given_Tf=mod.given("Tf");
  modelStruct.modelPar_Tft=mod.Tft;
  modelStruct.d_modelPar_Tft_dX=0.0;
  modelStruct.modelPar_given_Tft=mod.given("Tft");
  modelStruct.modelPar_Thcs=mod.Thcs;
  modelStruct.d_modelPar_Thcs_dX=0.0;
  modelStruct.modelPar_given_Thcs=mod.given("Thcs");
  modelStruct.modelPar_Ahc=mod.Ahc;
  modelStruct.d_modelPar_Ahc_dX=0.0;
  modelStruct.modelPar_given_Ahc=mod.given("Ahc");
  modelStruct.modelPar_Cje=mod.Cje;
  modelStruct.d_modelPar_Cje_dX=0.0;
  modelStruct.modelPar_given_Cje=mod.given("Cje");
  modelStruct.modelPar_mje=mod.mje;
  modelStruct.d_modelPar_mje_dX=0.0;
  modelStruct.modelPar_given_mje=mod.given("mje");
  modelStruct.modelPar_Vje=mod.Vje;
  modelStruct.d_modelPar_Vje_dX=0.0;
  modelStruct.modelPar_given_Vje=mod.given("Vje");
  modelStruct.modelPar_Cjc=mod.Cjc;
  modelStruct.d_modelPar_Cjc_dX=0.0;
  modelStruct.modelPar_given_Cjc=mod.given("Cjc");
  modelStruct.modelPar_mjc=mod.mjc;
  modelStruct.d_modelPar_mjc_dX=0.0;
  modelStruct.modelPar_given_mjc=mod.given("mjc");
  modelStruct.modelPar_Vjc=mod.Vjc;
  modelStruct.d_modelPar_Vjc_dX=0.0;
  modelStruct.modelPar_given_Vjc=mod.given("Vjc");
  modelStruct.modelPar_kjc=mod.kjc;
  modelStruct.d_modelPar_kjc_dX=0.0;
  modelStruct.modelPar_given_kjc=mod.given("kjc");
  modelStruct.modelPar_Cmin=mod.Cmin;
  modelStruct.d_modelPar_Cmin_dX=0.0;
  modelStruct.modelPar_given_Cmin=mod.given("Cmin");
  modelStruct.modelPar_J0=mod.J0;
  modelStruct.d_modelPar_J0_dX=0.0;
  modelStruct.modelPar_given_J0=mod.given("J0");
  modelStruct.modelPar_XJ0=mod.XJ0;
  modelStruct.d_modelPar_XJ0_dX=0.0;
  modelStruct.modelPar_given_XJ0=mod.given("XJ0");
  modelStruct.modelPar_Rci0=mod.Rci0;
  modelStruct.d_modelPar_Rci0_dX=0.0;
  modelStruct.modelPar_given_Rci0=mod.given("Rci0");
  modelStruct.modelPar_Jk=mod.Jk;
  modelStruct.d_modelPar_Jk_dX=0.0;
  modelStruct.modelPar_given_Jk=mod.given("Jk");
  modelStruct.modelPar_RJk=mod.RJk;
  modelStruct.d_modelPar_RJk_dX=0.0;
  modelStruct.modelPar_given_RJk=mod.given("RJk");
  modelStruct.modelPar_Vces=mod.Vces;
  modelStruct.d_modelPar_Vces_dX=0.0;
  modelStruct.modelPar_given_Vces=mod.given("Vces");
  modelStruct.modelPar_Rc=mod.Rc;
  modelStruct.d_modelPar_Rc_dX=0.0;
  modelStruct.modelPar_given_Rc=mod.given("Rc");
  modelStruct.modelPar_Re=mod.Re;
  modelStruct.d_modelPar_Re_dX=0.0;
  modelStruct.modelPar_given_Re=mod.given("Re");
  modelStruct.modelPar_Rb=mod.Rb;
  modelStruct.d_modelPar_Rb_dX=0.0;
  modelStruct.modelPar_given_Rb=mod.given("Rb");
  modelStruct.modelPar_Rb2=mod.Rb2;
  modelStruct.d_modelPar_Rb2_dX=0.0;
  modelStruct.modelPar_given_Rb2=mod.given("Rb2");
  modelStruct.modelPar_Lc=mod.Lc;
  modelStruct.d_modelPar_Lc_dX=0.0;
  modelStruct.modelPar_given_Lc=mod.given("Lc");
  modelStruct.modelPar_Le=mod.Le;
  modelStruct.d_modelPar_Le_dX=0.0;
  modelStruct.modelPar_given_Le=mod.given("Le");
  modelStruct.modelPar_Lb=mod.Lb;
  modelStruct.d_modelPar_Lb_dX=0.0;
  modelStruct.modelPar_given_Lb=mod.given("Lb");
  modelStruct.modelPar_Cq=mod.Cq;
  modelStruct.d_modelPar_Cq_dX=0.0;
  modelStruct.modelPar_given_Cq=mod.given("Cq");
  modelStruct.modelPar_Cpb=mod.Cpb;
  modelStruct.d_modelPar_Cpb_dX=0.0;
  modelStruct.modelPar_given_Cpb=mod.given("Cpb");
  modelStruct.modelPar_Cpc=mod.Cpc;
  modelStruct.d_modelPar_Cpc_dX=0.0;
  modelStruct.modelPar_given_Cpc=mod.given("Cpc");
  modelStruct.modelPar_Tnom=mod.Tnom;
  modelStruct.d_modelPar_Tnom_dX=0.0;
  modelStruct.modelPar_given_Tnom=mod.given("Tnom");


  // hidden reals


  // non-reals (including hiddens)
  modelStruct.modelPar_Mode=mod.Mode;
  modelStruct.modelPar_given_Mode=mod.given("Mode");
  modelStruct.modelPar_Noise=mod.Noise;
  modelStruct.modelPar_given_Noise=mod.given("Noise");
  modelStruct.modelPar_Debug=mod.Debug;
  modelStruct.modelPar_given_Debug=mod.given("Debug");
  modelStruct.modelPar_DebugPlus=mod.DebugPlus;
  modelStruct.modelPar_given_DebugPlus=mod.given("DebugPlus");
  modelStruct.modelPar_N=mod.N;
  modelStruct.modelPar_given_N=mod.given("N");
  modelStruct.modelPar_dtype=mod.dtype;



  // Copy out all the instance parameters (doubles) into local struct
  // Keep a map so we can set the right one to the independent variable
  // We do this solely to avoid a big ugly "if/else" block just to find the
  // one parameter we're doing sensitivities on.
  unordered_map <std::string,double*,HashNoCase,EqualNoCase> inParamMap;
  instanceSensStruct instanceStruct;
  // reals
  instanceStruct.instancePar_Temp=in.Temp;
  instanceStruct.d_instancePar_Temp_dX=0.0;
  instanceStruct.instancePar_given_Temp=in.given("Temp");
  inParamMap["Temp"] = &(instanceStruct.d_instancePar_Temp_dX);
  instanceStruct.instancePar_L=in.L;
  instanceStruct.d_instancePar_L_dX=0.0;
  instanceStruct.instancePar_given_L=in.given("L");
  inParamMap["L"] = &(instanceStruct.d_instancePar_L_dX);
  instanceStruct.instancePar_W=in.W;
  instanceStruct.d_instancePar_W_dX=0.0;
  instanceStruct.instancePar_given_W=in.given("W");
  inParamMap["W"] = &(instanceStruct.d_instancePar_W_dX);


  // Copy all the real hidden instance params into local struct



  // Copy all the non-real instance params into vars of their appropriate type:
  instanceStruct.instancePar_N=in.N;
  instanceStruct.instancePar_given_N=in.given("N");


  // Set the one parameter whose name was passed in to be the independent
  // variable for differentiation purposes.  Since we stored variable pointers, this
  // makes sure that that ONE variable gets set right.
  // FIXME: make this check the name first, otherwise segfault on invalid name!
  *(inParamMap[name])=1.0;

  //make local copies of all instance vars
  //reals


  //non-reals


  //make local copies of all model vars
  //reals


  // non-reals



  Linear::Vector * solVectorPtr = in.extData.nextSolVectorPtr;

  // extract solution variables
  probeVars[in.admsProbeID_V_t_ti] = (*solVectorPtr)[in.li_t]- (*solVectorPtr)[in.li_ti];
  probeVars[in.admsProbeID_V_b_c] = (*solVectorPtr)[in.li_b]- (*solVectorPtr)[in.li_c];
  probeVars[in.admsProbeID_V_c_GND] = (*solVectorPtr)[in.li_c];
  probeVars[in.admsProbeID_V_b_GND] = (*solVectorPtr)[in.li_b];
  probeVars[in.admsProbeID_V_cx_bii] = (*solVectorPtr)[in.li_cx]- (*solVectorPtr)[in.li_bii];
  probeVars[in.admsProbeID_V_exx_bii] = (*solVectorPtr)[in.li_exx]- (*solVectorPtr)[in.li_bii];
  probeVars[in.admsProbeID_V_ex_bii] = (*solVectorPtr)[in.li_ex]- (*solVectorPtr)[in.li_bii];
  probeVars[in.admsProbeID_V_bii_bi] = (*solVectorPtr)[in.li_bii]- (*solVectorPtr)[in.li_bi];

  probeVars[in.admsProbeID_I_c_ci] = (*solVectorPtr)[in.li_BRA_c_ci];
  probeVars[in.admsProbeID_I_e_ei] = (*solVectorPtr)[in.li_BRA_e_ei];
  probeVars[in.admsProbeID_I_b_bi] = (*solVectorPtr)[in.li_BRA_b_bi];probeVars[in.admsProbeID_V_ti_GND] = (*solVectorPtr)[in.li_ti];
  probeVars[in.admsProbeID_V_ci_ei] = (*solVectorPtr)[in.li_ci]- (*solVectorPtr)[in.li_ei];
  probeVars[in.admsProbeID_V_exx_ei] = (*solVectorPtr)[in.li_exx]- (*solVectorPtr)[in.li_ei];
  probeVars[in.admsProbeID_V_cx_ci] = (*solVectorPtr)[in.li_cx]- (*solVectorPtr)[in.li_ci];
  probeVars[in.admsProbeID_V_ex_ei] = (*solVectorPtr)[in.li_ex]- (*solVectorPtr)[in.li_ei];
  probeVars[in.admsProbeID_V_bii_ei] = (*solVectorPtr)[in.li_bii]- (*solVectorPtr)[in.li_ei];
  probeVars[in.admsProbeID_V_bii_ci] = (*solVectorPtr)[in.li_bii]- (*solVectorPtr)[in.li_ci];
  probeVars[in.admsProbeID_V_bi_ci] = (*solVectorPtr)[in.li_bi]- (*solVectorPtr)[in.li_ci];


  // pre-multiply any "typed" probes (i.e. those limited with "typedpnjlim")

  probeVars[in.admsProbeID_V_bii_ei] *= modelStruct.modelPar_dtype;
  probeVars[in.admsProbeID_V_bii_ci] *= modelStruct.modelPar_dtype;
  probeVars[in.admsProbeID_V_bi_ci] *= modelStruct.modelPar_dtype;



  // Now call  the function that does the heavy lifting.
  evaluateModelEquations(
     probeVars,
     // probe constants
     in.admsProbeID_V_t_ti,
     in.admsProbeID_V_b_c,
     in.admsProbeID_V_c_GND,
     in.admsProbeID_V_b_GND,
     in.admsProbeID_V_cx_bii,
     in.admsProbeID_V_exx_bii,
     in.admsProbeID_V_ex_bii,
     in.admsProbeID_V_bii_bi,
     in.admsProbeID_I_c_ci,
     in.admsProbeID_I_e_ei,
     in.admsProbeID_I_b_bi,
     in.admsProbeID_V_ti_GND,
     in.admsProbeID_V_ci_ei,
     in.admsProbeID_V_exx_ei,
     in.admsProbeID_V_cx_ci,
     in.admsProbeID_V_ex_ei,
     in.admsProbeID_V_bii_ei,
     in.admsProbeID_V_bii_ci,
     in.admsProbeID_V_bi_ci,

     // node constants
     in.admsNodeID_c,
     in.admsNodeID_b,
     in.admsNodeID_e,
     in.admsNodeID_t,
     in.admsNodeID_ei,
     in.admsNodeID_bi,
     in.admsNodeID_bii,
     in.admsNodeID_ci,
     in.admsNodeID_ti,
     in.admsNodeID_ex,
     in.admsNodeID_exx,
     in.admsNodeID_cx,
     in.admsBRA_ID_b_bi,
     in.admsBRA_ID_e_ei,
     in.admsBRA_ID_c_ci,
     instanceStruct,
     modelStruct,
     in.admsTemperature,
     in.adms_vt_nom,
     in.getDeviceOptions().gmin,
     d_staticContributions_dX,
     d_dynamicContributions_dX,
     in);


  // We now have the F and Q vector stuff, populate the dependencies:

  dfdp[in.admsNodeID_c] += d_staticContributions_dX[in.admsNodeID_c];
  dqdp[in.admsNodeID_c] += d_dynamicContributions_dX[in.admsNodeID_c];
  Findices[in.admsNodeID_c] = in.li_c;
  Qindices[in.admsNodeID_c] = in.li_c;
  dfdp[in.admsNodeID_b] += d_staticContributions_dX[in.admsNodeID_b];
  dqdp[in.admsNodeID_b] += d_dynamicContributions_dX[in.admsNodeID_b];
  Findices[in.admsNodeID_b] = in.li_b;
  Qindices[in.admsNodeID_b] = in.li_b;
  dfdp[in.admsNodeID_e] += d_staticContributions_dX[in.admsNodeID_e];
  dqdp[in.admsNodeID_e] += d_dynamicContributions_dX[in.admsNodeID_e];
  Findices[in.admsNodeID_e] = in.li_e;
  Qindices[in.admsNodeID_e] = in.li_e;
  dfdp[in.admsNodeID_t] += d_staticContributions_dX[in.admsNodeID_t];
  dqdp[in.admsNodeID_t] += d_dynamicContributions_dX[in.admsNodeID_t];
  Findices[in.admsNodeID_t] = in.li_t;
  Qindices[in.admsNodeID_t] = in.li_t;
  dfdp[in.admsNodeID_ei] += d_staticContributions_dX[in.admsNodeID_ei];
  dqdp[in.admsNodeID_ei] += d_dynamicContributions_dX[in.admsNodeID_ei];
  Findices[in.admsNodeID_ei] = in.li_ei;
  Qindices[in.admsNodeID_ei] = in.li_ei;
  dfdp[in.admsNodeID_bi] += d_staticContributions_dX[in.admsNodeID_bi];
  dqdp[in.admsNodeID_bi] += d_dynamicContributions_dX[in.admsNodeID_bi];
  Findices[in.admsNodeID_bi] = in.li_bi;
  Qindices[in.admsNodeID_bi] = in.li_bi;
  dfdp[in.admsNodeID_bii] += d_staticContributions_dX[in.admsNodeID_bii];
  dqdp[in.admsNodeID_bii] += d_dynamicContributions_dX[in.admsNodeID_bii];
  Findices[in.admsNodeID_bii] = in.li_bii;
  Qindices[in.admsNodeID_bii] = in.li_bii;
  dfdp[in.admsNodeID_ci] += d_staticContributions_dX[in.admsNodeID_ci];
  dqdp[in.admsNodeID_ci] += d_dynamicContributions_dX[in.admsNodeID_ci];
  Findices[in.admsNodeID_ci] = in.li_ci;
  Qindices[in.admsNodeID_ci] = in.li_ci;
  dfdp[in.admsNodeID_ti] += d_staticContributions_dX[in.admsNodeID_ti];
  dqdp[in.admsNodeID_ti] += d_dynamicContributions_dX[in.admsNodeID_ti];
  Findices[in.admsNodeID_ti] = in.li_ti;
  Qindices[in.admsNodeID_ti] = in.li_ti;
  dfdp[in.admsNodeID_ex] += d_staticContributions_dX[in.admsNodeID_ex];
  dqdp[in.admsNodeID_ex] += d_dynamicContributions_dX[in.admsNodeID_ex];
  Findices[in.admsNodeID_ex] = in.li_ex;
  Qindices[in.admsNodeID_ex] = in.li_ex;
  dfdp[in.admsNodeID_exx] += d_staticContributions_dX[in.admsNodeID_exx];
  dqdp[in.admsNodeID_exx] += d_dynamicContributions_dX[in.admsNodeID_exx];
  Findices[in.admsNodeID_exx] = in.li_exx;
  Qindices[in.admsNodeID_exx] = in.li_exx;
  dfdp[in.admsNodeID_cx] += d_staticContributions_dX[in.admsNodeID_cx];
  dqdp[in.admsNodeID_cx] += d_dynamicContributions_dX[in.admsNodeID_cx];
  Findices[in.admsNodeID_cx] = in.li_cx;
  Qindices[in.admsNodeID_cx] = in.li_cx;
  dfdp[in.admsBRA_ID_b_bi] += d_staticContributions_dX[in.admsBRA_ID_b_bi];
  dqdp[in.admsBRA_ID_b_bi] += d_dynamicContributions_dX[in.admsBRA_ID_b_bi];
  Findices[in.admsBRA_ID_b_bi] = in.li_BRA_b_bi;
  Qindices[in.admsBRA_ID_b_bi] = in.li_BRA_b_bi;
  dfdp[in.admsBRA_ID_e_ei] += d_staticContributions_dX[in.admsBRA_ID_e_ei];
  dqdp[in.admsBRA_ID_e_ei] += d_dynamicContributions_dX[in.admsBRA_ID_e_ei];
  Findices[in.admsBRA_ID_e_ei] = in.li_BRA_e_ei;
  Qindices[in.admsBRA_ID_e_ei] = in.li_BRA_e_ei;
  dfdp[in.admsBRA_ID_c_ci] += d_staticContributions_dX[in.admsBRA_ID_c_ci];
  dqdp[in.admsBRA_ID_c_ci] += d_dynamicContributions_dX[in.admsBRA_ID_c_ci];
  Findices[in.admsBRA_ID_c_ci] = in.li_BRA_c_ci;
  Qindices[in.admsBRA_ID_c_ci] = in.li_BRA_c_ci;


}

//-----------------------------------------------------------------------------
// Function      : ModelSensitivity::operator()
// Purpose       : return sensitivity for a single model parameter
// Special Notes :
// Scope         : public
// Creator       : admsXml
// Creation Date :
//-----------------------------------------------------------------------------
/// Compute sensitivity to a specified model
/// parameter of all device instances of that model's outputs
///
///
/// @param[in] entity  The device entity that owns the parameter
/// @param[in] name    The unadorned parameter name specific to the entity
/// @param[out] dfdp   The derivative of the F vector with respect to the parameter
/// @param[out] dqdp   The derivative of the Q vector with respect to the parameter
/// @param[out] dbdp   The derivative of the B vector with respect to the parameter
/// @param[out] Findices   The indices into the F vector corresponding to the elements of dfdp
/// @param[out] Qindices   The indices into the Q vector corresponding to the elements of dfdp
/// @param[out] Bindices   The indices into the B vector corresponding to the elements of dfdp
///
///
void ModelSensitivity::operator()
  (
     const ParameterBase &entity,
     const std::string &name,
     std::vector<double> & dfdp,
     std::vector<double> & dqdp,
     std::vector<double> & dbdp,
     std::vector<int> & Findices,
     std::vector<int> & Qindices,
     std::vector<int> & Bindices
   ) const
{
  const ParameterBase * e1 = &entity;
  const Model & mod = *(dynamic_cast<const Model *> (e1));
  int sizeInstance = mod.instanceContainer.size();

  dfdp.resize((12+3)*sizeInstance);
  dqdp.resize((12+3)*sizeInstance);
  Findices.resize((12+3)*sizeInstance);
  Qindices.resize((12+3)*sizeInstance);

  std::vector <double> probeVars(19);
  std::vector <double> d_staticContributions_dX(12+3);
  std::vector <double> d_dynamicContributions_dX(12+3);


  // Copy out all the model parameters (doubles) into local structure
  modelSensStruct modelStruct;

  // Keep a map so we can set the right one to the independent variable
  // We do this solely to avoid a big ugly "if/else" block just to find the
  // one parameter we're doing sensitivities on.
  unordered_map <std::string,double*,HashNoCase,EqualNoCase> modParamMap;

  // reals
  modelStruct.modelPar_Temp=mod.Temp;
  modelStruct.d_modelPar_Temp_dX=0.0;
  modelStruct.modelPar_given_Temp=mod.given("Temp");
  modParamMap["Temp"] = &(modelStruct.d_modelPar_Temp_dX);
  modelStruct.modelPar_Rth=mod.Rth;
  modelStruct.d_modelPar_Rth_dX=0.0;
  modelStruct.modelPar_given_Rth=mod.given("Rth");
  modParamMap["Rth"] = &(modelStruct.d_modelPar_Rth_dX);
  modelStruct.modelPar_Cth=mod.Cth;
  modelStruct.d_modelPar_Cth_dX=0.0;
  modelStruct.modelPar_given_Cth=mod.given("Cth");
  modParamMap["Cth"] = &(modelStruct.d_modelPar_Cth_dX);
  modelStruct.modelPar_L=mod.L;
  modelStruct.d_modelPar_L_dX=0.0;
  modelStruct.modelPar_given_L=mod.given("L");
  modParamMap["L"] = &(modelStruct.d_modelPar_L_dX);
  modelStruct.modelPar_W=mod.W;
  modelStruct.d_modelPar_W_dX=0.0;
  modelStruct.modelPar_given_W=mod.given("W");
  modParamMap["W"] = &(modelStruct.d_modelPar_W_dX);
  modelStruct.modelPar_Jsf=mod.Jsf;
  modelStruct.d_modelPar_Jsf_dX=0.0;
  modelStruct.modelPar_given_Jsf=mod.given("Jsf");
  modParamMap["Jsf"] = &(modelStruct.d_modelPar_Jsf_dX);
  modelStruct.modelPar_nf=mod.nf;
  modelStruct.d_modelPar_nf_dX=0.0;
  modelStruct.modelPar_given_nf=mod.given("nf");
  modParamMap["nf"] = &(modelStruct.d_modelPar_nf_dX);
  modelStruct.modelPar_Vg=mod.Vg;
  modelStruct.d_modelPar_Vg_dX=0.0;
  modelStruct.modelPar_given_Vg=mod.given("Vg");
  modParamMap["Vg"] = &(modelStruct.d_modelPar_Vg_dX);
  modelStruct.modelPar_Jse=mod.Jse;
  modelStruct.d_modelPar_Jse_dX=0.0;
  modelStruct.modelPar_given_Jse=mod.given("Jse");
  modParamMap["Jse"] = &(modelStruct.d_modelPar_Jse_dX);
  modelStruct.modelPar_ne=mod.ne;
  modelStruct.d_modelPar_ne_dX=0.0;
  modelStruct.modelPar_given_ne=mod.given("ne");
  modParamMap["ne"] = &(modelStruct.d_modelPar_ne_dX);
  modelStruct.modelPar_Rbxx=mod.Rbxx;
  modelStruct.d_modelPar_Rbxx_dX=0.0;
  modelStruct.modelPar_given_Rbxx=mod.given("Rbxx");
  modParamMap["Rbxx"] = &(modelStruct.d_modelPar_Rbxx_dX);
  modelStruct.modelPar_Vgb=mod.Vgb;
  modelStruct.d_modelPar_Vgb_dX=0.0;
  modelStruct.modelPar_given_Vgb=mod.given("Vgb");
  modParamMap["Vgb"] = &(modelStruct.d_modelPar_Vgb_dX);
  modelStruct.modelPar_Jsee=mod.Jsee;
  modelStruct.d_modelPar_Jsee_dX=0.0;
  modelStruct.modelPar_given_Jsee=mod.given("Jsee");
  modParamMap["Jsee"] = &(modelStruct.d_modelPar_Jsee_dX);
  modelStruct.modelPar_nee=mod.nee;
  modelStruct.d_modelPar_nee_dX=0.0;
  modelStruct.modelPar_given_nee=mod.given("nee");
  modParamMap["nee"] = &(modelStruct.d_modelPar_nee_dX);
  modelStruct.modelPar_Rbbxx=mod.Rbbxx;
  modelStruct.d_modelPar_Rbbxx_dX=0.0;
  modelStruct.modelPar_given_Rbbxx=mod.given("Rbbxx");
  modParamMap["Rbbxx"] = &(modelStruct.d_modelPar_Rbbxx_dX);
  modelStruct.modelPar_Vgbb=mod.Vgbb;
  modelStruct.d_modelPar_Vgbb_dX=0.0;
  modelStruct.modelPar_given_Vgbb=mod.given("Vgbb");
  modParamMap["Vgbb"] = &(modelStruct.d_modelPar_Vgbb_dX);
  modelStruct.modelPar_Jsr=mod.Jsr;
  modelStruct.d_modelPar_Jsr_dX=0.0;
  modelStruct.modelPar_given_Jsr=mod.given("Jsr");
  modParamMap["Jsr"] = &(modelStruct.d_modelPar_Jsr_dX);
  modelStruct.modelPar_nr=mod.nr;
  modelStruct.d_modelPar_nr_dX=0.0;
  modelStruct.modelPar_given_nr=mod.given("nr");
  modParamMap["nr"] = &(modelStruct.d_modelPar_nr_dX);
  modelStruct.modelPar_Vgr=mod.Vgr;
  modelStruct.d_modelPar_Vgr_dX=0.0;
  modelStruct.modelPar_given_Vgr=mod.given("Vgr");
  modParamMap["Vgr"] = &(modelStruct.d_modelPar_Vgr_dX);
  modelStruct.modelPar_XCjc=mod.XCjc;
  modelStruct.d_modelPar_XCjc_dX=0.0;
  modelStruct.modelPar_given_XCjc=mod.given("XCjc");
  modParamMap["XCjc"] = &(modelStruct.d_modelPar_XCjc_dX);
  modelStruct.modelPar_Jsc=mod.Jsc;
  modelStruct.d_modelPar_Jsc_dX=0.0;
  modelStruct.modelPar_given_Jsc=mod.given("Jsc");
  modParamMap["Jsc"] = &(modelStruct.d_modelPar_Jsc_dX);
  modelStruct.modelPar_nc=mod.nc;
  modelStruct.d_modelPar_nc_dX=0.0;
  modelStruct.modelPar_given_nc=mod.given("nc");
  modParamMap["nc"] = &(modelStruct.d_modelPar_nc_dX);
  modelStruct.modelPar_Rcxx=mod.Rcxx;
  modelStruct.d_modelPar_Rcxx_dX=0.0;
  modelStruct.modelPar_given_Rcxx=mod.given("Rcxx");
  modParamMap["Rcxx"] = &(modelStruct.d_modelPar_Rcxx_dX);
  modelStruct.modelPar_Vgc=mod.Vgc;
  modelStruct.d_modelPar_Vgc_dX=0.0;
  modelStruct.modelPar_given_Vgc=mod.given("Vgc");
  modParamMap["Vgc"] = &(modelStruct.d_modelPar_Vgc_dX);
  modelStruct.modelPar_Bf=mod.Bf;
  modelStruct.d_modelPar_Bf_dX=0.0;
  modelStruct.modelPar_given_Bf=mod.given("Bf");
  modParamMap["Bf"] = &(modelStruct.d_modelPar_Bf_dX);
  modelStruct.modelPar_kBeta=mod.kBeta;
  modelStruct.d_modelPar_kBeta_dX=0.0;
  modelStruct.modelPar_given_kBeta=mod.given("kBeta");
  modParamMap["kBeta"] = &(modelStruct.d_modelPar_kBeta_dX);
  modelStruct.modelPar_Br=mod.Br;
  modelStruct.d_modelPar_Br_dX=0.0;
  modelStruct.modelPar_given_Br=mod.given("Br");
  modParamMap["Br"] = &(modelStruct.d_modelPar_Br_dX);
  modelStruct.modelPar_VAF=mod.VAF;
  modelStruct.d_modelPar_VAF_dX=0.0;
  modelStruct.modelPar_given_VAF=mod.given("VAF");
  modParamMap["VAF"] = &(modelStruct.d_modelPar_VAF_dX);
  modelStruct.modelPar_VAR=mod.VAR;
  modelStruct.d_modelPar_VAR_dX=0.0;
  modelStruct.modelPar_given_VAR=mod.given("VAR");
  modParamMap["VAR"] = &(modelStruct.d_modelPar_VAR_dX);
  modelStruct.modelPar_IKF=mod.IKF;
  modelStruct.d_modelPar_IKF_dX=0.0;
  modelStruct.modelPar_given_IKF=mod.given("IKF");
  modParamMap["IKF"] = &(modelStruct.d_modelPar_IKF_dX);
  modelStruct.modelPar_IKR=mod.IKR;
  modelStruct.d_modelPar_IKR_dX=0.0;
  modelStruct.modelPar_given_IKR=mod.given("IKR");
  modParamMap["IKR"] = &(modelStruct.d_modelPar_IKR_dX);
  modelStruct.modelPar_Mc=mod.Mc;
  modelStruct.d_modelPar_Mc_dX=0.0;
  modelStruct.modelPar_given_Mc=mod.given("Mc");
  modParamMap["Mc"] = &(modelStruct.d_modelPar_Mc_dX);
  modelStruct.modelPar_BVceo=mod.BVceo;
  modelStruct.d_modelPar_BVceo_dX=0.0;
  modelStruct.modelPar_given_BVceo=mod.given("BVceo");
  modParamMap["BVceo"] = &(modelStruct.d_modelPar_BVceo_dX);
  modelStruct.modelPar_kc=mod.kc;
  modelStruct.d_modelPar_kc_dX=0.0;
  modelStruct.modelPar_given_kc=mod.given("kc");
  modParamMap["kc"] = &(modelStruct.d_modelPar_kc_dX);
  modelStruct.modelPar_BVebo=mod.BVebo;
  modelStruct.d_modelPar_BVebo_dX=0.0;
  modelStruct.modelPar_given_BVebo=mod.given("BVebo");
  modParamMap["BVebo"] = &(modelStruct.d_modelPar_BVebo_dX);
  modelStruct.modelPar_Tr=mod.Tr;
  modelStruct.d_modelPar_Tr_dX=0.0;
  modelStruct.modelPar_given_Tr=mod.given("Tr");
  modParamMap["Tr"] = &(modelStruct.d_modelPar_Tr_dX);
  modelStruct.modelPar_Trx=mod.Trx;
  modelStruct.d_modelPar_Trx_dX=0.0;
  modelStruct.modelPar_given_Trx=mod.given("Trx");
  modParamMap["Trx"] = &(modelStruct.d_modelPar_Trx_dX);
  modelStruct.modelPar_Tf=mod.Tf;
  modelStruct.d_modelPar_Tf_dX=0.0;
  modelStruct.modelPar_given_Tf=mod.given("Tf");
  modParamMap["Tf"] = &(modelStruct.d_modelPar_Tf_dX);
  modelStruct.modelPar_Tft=mod.Tft;
  modelStruct.d_modelPar_Tft_dX=0.0;
  modelStruct.modelPar_given_Tft=mod.given("Tft");
  modParamMap["Tft"] = &(modelStruct.d_modelPar_Tft_dX);
  modelStruct.modelPar_Thcs=mod.Thcs;
  modelStruct.d_modelPar_Thcs_dX=0.0;
  modelStruct.modelPar_given_Thcs=mod.given("Thcs");
  modParamMap["Thcs"] = &(modelStruct.d_modelPar_Thcs_dX);
  modelStruct.modelPar_Ahc=mod.Ahc;
  modelStruct.d_modelPar_Ahc_dX=0.0;
  modelStruct.modelPar_given_Ahc=mod.given("Ahc");
  modParamMap["Ahc"] = &(modelStruct.d_modelPar_Ahc_dX);
  modelStruct.modelPar_Cje=mod.Cje;
  modelStruct.d_modelPar_Cje_dX=0.0;
  modelStruct.modelPar_given_Cje=mod.given("Cje");
  modParamMap["Cje"] = &(modelStruct.d_modelPar_Cje_dX);
  modelStruct.modelPar_mje=mod.mje;
  modelStruct.d_modelPar_mje_dX=0.0;
  modelStruct.modelPar_given_mje=mod.given("mje");
  modParamMap["mje"] = &(modelStruct.d_modelPar_mje_dX);
  modelStruct.modelPar_Vje=mod.Vje;
  modelStruct.d_modelPar_Vje_dX=0.0;
  modelStruct.modelPar_given_Vje=mod.given("Vje");
  modParamMap["Vje"] = &(modelStruct.d_modelPar_Vje_dX);
  modelStruct.modelPar_Cjc=mod.Cjc;
  modelStruct.d_modelPar_Cjc_dX=0.0;
  modelStruct.modelPar_given_Cjc=mod.given("Cjc");
  modParamMap["Cjc"] = &(modelStruct.d_modelPar_Cjc_dX);
  modelStruct.modelPar_mjc=mod.mjc;
  modelStruct.d_modelPar_mjc_dX=0.0;
  modelStruct.modelPar_given_mjc=mod.given("mjc");
  modParamMap["mjc"] = &(modelStruct.d_modelPar_mjc_dX);
  modelStruct.modelPar_Vjc=mod.Vjc;
  modelStruct.d_modelPar_Vjc_dX=0.0;
  modelStruct.modelPar_given_Vjc=mod.given("Vjc");
  modParamMap["Vjc"] = &(modelStruct.d_modelPar_Vjc_dX);
  modelStruct.modelPar_kjc=mod.kjc;
  modelStruct.d_modelPar_kjc_dX=0.0;
  modelStruct.modelPar_given_kjc=mod.given("kjc");
  modParamMap["kjc"] = &(modelStruct.d_modelPar_kjc_dX);
  modelStruct.modelPar_Cmin=mod.Cmin;
  modelStruct.d_modelPar_Cmin_dX=0.0;
  modelStruct.modelPar_given_Cmin=mod.given("Cmin");
  modParamMap["Cmin"] = &(modelStruct.d_modelPar_Cmin_dX);
  modelStruct.modelPar_J0=mod.J0;
  modelStruct.d_modelPar_J0_dX=0.0;
  modelStruct.modelPar_given_J0=mod.given("J0");
  modParamMap["J0"] = &(modelStruct.d_modelPar_J0_dX);
  modelStruct.modelPar_XJ0=mod.XJ0;
  modelStruct.d_modelPar_XJ0_dX=0.0;
  modelStruct.modelPar_given_XJ0=mod.given("XJ0");
  modParamMap["XJ0"] = &(modelStruct.d_modelPar_XJ0_dX);
  modelStruct.modelPar_Rci0=mod.Rci0;
  modelStruct.d_modelPar_Rci0_dX=0.0;
  modelStruct.modelPar_given_Rci0=mod.given("Rci0");
  modParamMap["Rci0"] = &(modelStruct.d_modelPar_Rci0_dX);
  modelStruct.modelPar_Jk=mod.Jk;
  modelStruct.d_modelPar_Jk_dX=0.0;
  modelStruct.modelPar_given_Jk=mod.given("Jk");
  modParamMap["Jk"] = &(modelStruct.d_modelPar_Jk_dX);
  modelStruct.modelPar_RJk=mod.RJk;
  modelStruct.d_modelPar_RJk_dX=0.0;
  modelStruct.modelPar_given_RJk=mod.given("RJk");
  modParamMap["RJk"] = &(modelStruct.d_modelPar_RJk_dX);
  modelStruct.modelPar_Vces=mod.Vces;
  modelStruct.d_modelPar_Vces_dX=0.0;
  modelStruct.modelPar_given_Vces=mod.given("Vces");
  modParamMap["Vces"] = &(modelStruct.d_modelPar_Vces_dX);
  modelStruct.modelPar_Rc=mod.Rc;
  modelStruct.d_modelPar_Rc_dX=0.0;
  modelStruct.modelPar_given_Rc=mod.given("Rc");
  modParamMap["Rc"] = &(modelStruct.d_modelPar_Rc_dX);
  modelStruct.modelPar_Re=mod.Re;
  modelStruct.d_modelPar_Re_dX=0.0;
  modelStruct.modelPar_given_Re=mod.given("Re");
  modParamMap["Re"] = &(modelStruct.d_modelPar_Re_dX);
  modelStruct.modelPar_Rb=mod.Rb;
  modelStruct.d_modelPar_Rb_dX=0.0;
  modelStruct.modelPar_given_Rb=mod.given("Rb");
  modParamMap["Rb"] = &(modelStruct.d_modelPar_Rb_dX);
  modelStruct.modelPar_Rb2=mod.Rb2;
  modelStruct.d_modelPar_Rb2_dX=0.0;
  modelStruct.modelPar_given_Rb2=mod.given("Rb2");
  modParamMap["Rb2"] = &(modelStruct.d_modelPar_Rb2_dX);
  modelStruct.modelPar_Lc=mod.Lc;
  modelStruct.d_modelPar_Lc_dX=0.0;
  modelStruct.modelPar_given_Lc=mod.given("Lc");
  modParamMap["Lc"] = &(modelStruct.d_modelPar_Lc_dX);
  modelStruct.modelPar_Le=mod.Le;
  modelStruct.d_modelPar_Le_dX=0.0;
  modelStruct.modelPar_given_Le=mod.given("Le");
  modParamMap["Le"] = &(modelStruct.d_modelPar_Le_dX);
  modelStruct.modelPar_Lb=mod.Lb;
  modelStruct.d_modelPar_Lb_dX=0.0;
  modelStruct.modelPar_given_Lb=mod.given("Lb");
  modParamMap["Lb"] = &(modelStruct.d_modelPar_Lb_dX);
  modelStruct.modelPar_Cq=mod.Cq;
  modelStruct.d_modelPar_Cq_dX=0.0;
  modelStruct.modelPar_given_Cq=mod.given("Cq");
  modParamMap["Cq"] = &(modelStruct.d_modelPar_Cq_dX);
  modelStruct.modelPar_Cpb=mod.Cpb;
  modelStruct.d_modelPar_Cpb_dX=0.0;
  modelStruct.modelPar_given_Cpb=mod.given("Cpb");
  modParamMap["Cpb"] = &(modelStruct.d_modelPar_Cpb_dX);
  modelStruct.modelPar_Cpc=mod.Cpc;
  modelStruct.d_modelPar_Cpc_dX=0.0;
  modelStruct.modelPar_given_Cpc=mod.given("Cpc");
  modParamMap["Cpc"] = &(modelStruct.d_modelPar_Cpc_dX);
  modelStruct.modelPar_Tnom=mod.Tnom;
  modelStruct.d_modelPar_Tnom_dX=0.0;
  modelStruct.modelPar_given_Tnom=mod.given("Tnom");
  modParamMap["Tnom"] = &(modelStruct.d_modelPar_Tnom_dX);


  // hidden reals


  // non-reals (including hiddens)
  modelStruct.modelPar_Mode=mod.Mode;
  modelStruct.modelPar_given_Mode=mod.given("Mode");
  modelStruct.modelPar_Noise=mod.Noise;
  modelStruct.modelPar_given_Noise=mod.given("Noise");
  modelStruct.modelPar_Debug=mod.Debug;
  modelStruct.modelPar_given_Debug=mod.given("Debug");
  modelStruct.modelPar_DebugPlus=mod.DebugPlus;
  modelStruct.modelPar_given_DebugPlus=mod.given("DebugPlus");
  modelStruct.modelPar_N=mod.N;
  modelStruct.modelPar_given_N=mod.given("N");
  modelStruct.modelPar_dtype=mod.dtype;


  // Set the one parameter whose name was passed in to be the independent
  // variable for differentiation purposes.  Since we stored variable pointers, this
  // makes sure that that ONE variable gets set right.
  // FIXME: make this check name for presence first!  Segfault on invalid.
  *(modParamMap[name])=1.0;

  //make local copies of all model vars
  //reals


  // non-reals



  // Now loop over all instances and do the deed
  int inst=0;
  for (std::vector<Instance*>::const_iterator in_it=mod.instanceContainer.begin(); in_it != mod.instanceContainer.end(); ++in_it,++inst)
  {

    Instance & in=*(*in_it);
    // initialize contributions to zero (automatically sets derivatives to zero)
    for (int i=0; i < 12+3 ; ++i)
    {
      d_staticContributions_dX[i]=0;
      d_dynamicContributions_dX[i]=0;
    }



    // Copy out all the instance parameters (doubles) into local struct
    instanceSensStruct instanceStruct;

    // reals
    instanceStruct.instancePar_Temp=in.Temp;
    instanceStruct.d_instancePar_Temp_dX=0.0;
    instanceStruct.instancePar_given_Temp=in.given("Temp");
    instanceStruct.instancePar_L=in.L;
    instanceStruct.d_instancePar_L_dX=0.0;
    instanceStruct.instancePar_given_L=in.given("L");
    instanceStruct.instancePar_W=in.W;
    instanceStruct.d_instancePar_W_dX=0.0;
    instanceStruct.instancePar_given_W=in.given("W");


    // real hidden instance


    // Copy all the non-real instance params into vars of their appropriate type:
    instanceStruct.instancePar_N=in.N;
    instanceStruct.instancePar_given_N=in.given("N");




    // If there are any instance parameters that were not given, and have
    // corresponding model params, copy the model param into the instance.
    // This was already done by the instance constructor, but we do it again
    // because now we're propagating derivatives, and the user could be trying
    // to get sensitivity to the model parameter.
    if (!(in.given("Temp")))
    {
      instanceStruct.instancePar_Temp = modelStruct.modelPar_Temp;
      instanceStruct.d_instancePar_Temp_dX = modelStruct.d_modelPar_Temp_dX;
    }
    if (!(in.given("N")))
    {
      instanceStruct.instancePar_N = modelStruct.modelPar_N;
    }
    if (!(in.given("L")))
    {
      instanceStruct.instancePar_L = modelStruct.modelPar_L;
      instanceStruct.d_instancePar_L_dX = modelStruct.d_modelPar_L_dX;
    }
    if (!(in.given("W")))
    {
      instanceStruct.instancePar_W = modelStruct.modelPar_W;
      instanceStruct.d_instancePar_W_dX = modelStruct.d_modelPar_W_dX;
    }


    //make local copies of all instance vars
    //reals


    //non-reals



    Linear::Vector * solVectorPtr = in.extData.nextSolVectorPtr;

    // extract solution variables
    probeVars[in.admsProbeID_V_t_ti] = (*solVectorPtr)[in.li_t] - (*solVectorPtr)[in.li_ti];
    probeVars[in.admsProbeID_V_b_c] = (*solVectorPtr)[in.li_b] - (*solVectorPtr)[in.li_c];
    probeVars[in.admsProbeID_V_c_GND] = (*solVectorPtr)[in.li_c];
    probeVars[in.admsProbeID_V_b_GND] = (*solVectorPtr)[in.li_b];
    probeVars[in.admsProbeID_V_cx_bii] = (*solVectorPtr)[in.li_cx] - (*solVectorPtr)[in.li_bii];
    probeVars[in.admsProbeID_V_exx_bii] = (*solVectorPtr)[in.li_exx] - (*solVectorPtr)[in.li_bii];
    probeVars[in.admsProbeID_V_ex_bii] = (*solVectorPtr)[in.li_ex] - (*solVectorPtr)[in.li_bii];
    probeVars[in.admsProbeID_V_bii_bi] = (*solVectorPtr)[in.li_bii] - (*solVectorPtr)[in.li_bi];
    probeVars[in.admsProbeID_I_c_ci] = (*solVectorPtr)[in.li_BRA_c_ci];
    probeVars[in.admsProbeID_I_e_ei] = (*solVectorPtr)[in.li_BRA_e_ei];
    probeVars[in.admsProbeID_I_b_bi] = (*solVectorPtr)[in.li_BRA_b_bi];
    probeVars[in.admsProbeID_V_ti_GND] = (*solVectorPtr)[in.li_ti];
    probeVars[in.admsProbeID_V_ci_ei] = (*solVectorPtr)[in.li_ci] - (*solVectorPtr)[in.li_ei];
    probeVars[in.admsProbeID_V_exx_ei] = (*solVectorPtr)[in.li_exx] - (*solVectorPtr)[in.li_ei];
    probeVars[in.admsProbeID_V_cx_ci] = (*solVectorPtr)[in.li_cx] - (*solVectorPtr)[in.li_ci];
    probeVars[in.admsProbeID_V_ex_ei] = (*solVectorPtr)[in.li_ex] - (*solVectorPtr)[in.li_ei];
    probeVars[in.admsProbeID_V_bii_ei] = (*solVectorPtr)[in.li_bii] - (*solVectorPtr)[in.li_ei];
    probeVars[in.admsProbeID_V_bii_ci] = (*solVectorPtr)[in.li_bii] - (*solVectorPtr)[in.li_ci];
    probeVars[in.admsProbeID_V_bi_ci] = (*solVectorPtr)[in.li_bi] - (*solVectorPtr)[in.li_ci];


    // pre-multiply any "typed" probes (i.e. those limited with "typedpnjlim")
    probeVars[in.admsProbeID_V_bii_ei] *= modelStruct.modelPar_dtype;
    probeVars[in.admsProbeID_V_bii_ci] *= modelStruct.modelPar_dtype;
    probeVars[in.admsProbeID_V_bi_ci] *= modelStruct.modelPar_dtype;




    // Now call  the function that does the heavy lifting.

    evaluateModelEquations(
       probeVars,
       // probe constants
       in.admsProbeID_V_t_ti,
       in.admsProbeID_V_b_c,
       in.admsProbeID_V_c_GND,
       in.admsProbeID_V_b_GND,
       in.admsProbeID_V_cx_bii,
       in.admsProbeID_V_exx_bii,
       in.admsProbeID_V_ex_bii,
       in.admsProbeID_V_bii_bi,
       in.admsProbeID_I_c_ci,
       in.admsProbeID_I_e_ei,
       in.admsProbeID_I_b_bi,
       in.admsProbeID_V_ti_GND,
       in.admsProbeID_V_ci_ei,
       in.admsProbeID_V_exx_ei,
       in.admsProbeID_V_cx_ci,
       in.admsProbeID_V_ex_ei,
       in.admsProbeID_V_bii_ei,
       in.admsProbeID_V_bii_ci,
       in.admsProbeID_V_bi_ci,

       // node constants
       in.admsNodeID_c,
       in.admsNodeID_b,
       in.admsNodeID_e,
       in.admsNodeID_t,
       in.admsNodeID_ei,
       in.admsNodeID_bi,
       in.admsNodeID_bii,
       in.admsNodeID_ci,
       in.admsNodeID_ti,
       in.admsNodeID_ex,
       in.admsNodeID_exx,
       in.admsNodeID_cx,
       in.admsBRA_ID_b_bi,
       in.admsBRA_ID_e_ei,
       in.admsBRA_ID_c_ci,
       instanceStruct,
       modelStruct,
       in.admsTemperature,
       in.adms_vt_nom,
       in.getDeviceOptions().gmin,
       d_staticContributions_dX,
       d_dynamicContributions_dX,
       in);


    // We now have the F and Q vector stuff, populate the dependencies:

    dfdp[in.admsNodeID_c+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_c];
    dqdp[in.admsNodeID_c+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_c];
    Findices[in.admsNodeID_c+inst*(12+3)] = in.li_c;
    Qindices[in.admsNodeID_c+inst*(12+3)] = in.li_c;
    dfdp[in.admsNodeID_b+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_b];
    dqdp[in.admsNodeID_b+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_b];
    Findices[in.admsNodeID_b+inst*(12+3)] = in.li_b;
    Qindices[in.admsNodeID_b+inst*(12+3)] = in.li_b;
    dfdp[in.admsNodeID_e+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_e];
    dqdp[in.admsNodeID_e+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_e];
    Findices[in.admsNodeID_e+inst*(12+3)] = in.li_e;
    Qindices[in.admsNodeID_e+inst*(12+3)] = in.li_e;
    dfdp[in.admsNodeID_t+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_t];
    dqdp[in.admsNodeID_t+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_t];
    Findices[in.admsNodeID_t+inst*(12+3)] = in.li_t;
    Qindices[in.admsNodeID_t+inst*(12+3)] = in.li_t;
    dfdp[in.admsNodeID_ei+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_ei];
    dqdp[in.admsNodeID_ei+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_ei];
    Findices[in.admsNodeID_ei+inst*(12+3)] = in.li_ei;
    Qindices[in.admsNodeID_ei+inst*(12+3)] = in.li_ei;
    dfdp[in.admsNodeID_bi+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_bi];
    dqdp[in.admsNodeID_bi+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_bi];
    Findices[in.admsNodeID_bi+inst*(12+3)] = in.li_bi;
    Qindices[in.admsNodeID_bi+inst*(12+3)] = in.li_bi;
    dfdp[in.admsNodeID_bii+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_bii];
    dqdp[in.admsNodeID_bii+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_bii];
    Findices[in.admsNodeID_bii+inst*(12+3)] = in.li_bii;
    Qindices[in.admsNodeID_bii+inst*(12+3)] = in.li_bii;
    dfdp[in.admsNodeID_ci+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_ci];
    dqdp[in.admsNodeID_ci+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_ci];
    Findices[in.admsNodeID_ci+inst*(12+3)] = in.li_ci;
    Qindices[in.admsNodeID_ci+inst*(12+3)] = in.li_ci;
    dfdp[in.admsNodeID_ti+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_ti];
    dqdp[in.admsNodeID_ti+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_ti];
    Findices[in.admsNodeID_ti+inst*(12+3)] = in.li_ti;
    Qindices[in.admsNodeID_ti+inst*(12+3)] = in.li_ti;
    dfdp[in.admsNodeID_ex+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_ex];
    dqdp[in.admsNodeID_ex+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_ex];
    Findices[in.admsNodeID_ex+inst*(12+3)] = in.li_ex;
    Qindices[in.admsNodeID_ex+inst*(12+3)] = in.li_ex;
    dfdp[in.admsNodeID_exx+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_exx];
    dqdp[in.admsNodeID_exx+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_exx];
    Findices[in.admsNodeID_exx+inst*(12+3)] = in.li_exx;
    Qindices[in.admsNodeID_exx+inst*(12+3)] = in.li_exx;
    dfdp[in.admsNodeID_cx+inst*(12+3)] += d_staticContributions_dX[in.admsNodeID_cx];
    dqdp[in.admsNodeID_cx+inst*(12+3)] += d_dynamicContributions_dX[in.admsNodeID_cx];
    Findices[in.admsNodeID_cx+inst*(12+3)] = in.li_cx;
    Qindices[in.admsNodeID_cx+inst*(12+3)] = in.li_cx;
    dfdp[in.admsBRA_ID_b_bi+inst*(12+3)] += d_staticContributions_dX[in.admsBRA_ID_b_bi];
    dqdp[in.admsBRA_ID_b_bi+inst*(12+3)] += d_dynamicContributions_dX[in.admsBRA_ID_b_bi];
    Findices[in.admsBRA_ID_b_bi+inst*(12+3)] = in.li_BRA_b_bi;
    Qindices[in.admsBRA_ID_b_bi+inst*(12+3)] = in.li_BRA_b_bi;
    dfdp[in.admsBRA_ID_e_ei+inst*(12+3)] += d_staticContributions_dX[in.admsBRA_ID_e_ei];
    dqdp[in.admsBRA_ID_e_ei+inst*(12+3)] += d_dynamicContributions_dX[in.admsBRA_ID_e_ei];
    Findices[in.admsBRA_ID_e_ei+inst*(12+3)] = in.li_BRA_e_ei;
    Qindices[in.admsBRA_ID_e_ei+inst*(12+3)] = in.li_BRA_e_ei;
    dfdp[in.admsBRA_ID_c_ci+inst*(12+3)] += d_staticContributions_dX[in.admsBRA_ID_c_ci];
    dqdp[in.admsBRA_ID_c_ci+inst*(12+3)] += d_dynamicContributions_dX[in.admsBRA_ID_c_ci];
    Findices[in.admsBRA_ID_c_ci+inst*(12+3)] = in.li_BRA_c_ci;
    Qindices[in.admsBRA_ID_c_ci+inst*(12+3)] = in.li_BRA_c_ci;
  }

}

#endif // Xyce_ADMS_SENSITIVITIES

} // namespace ADMSHBT_X
} // namespace Device
} // namespace Xyce
